Skip to content

Commit fa0a66e

Browse files
authored
bpo-40613: Remove compiler warning from _xxsubinterpretersmodule (GH-20069)
1 parent b809717 commit fa0a66e

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

Modules/_xxsubinterpretersmodule.c

+8
Original file line numberDiff line numberDiff line change
@@ -329,13 +329,15 @@ _objsnapshot_clear(_objsnapshot *osn)
329329
// PyMem_Free(osn);
330330
//}
331331

332+
#ifndef NDEBUG
332333
static int
333334
_objsnapshot_is_clear(_objsnapshot *osn)
334335
{
335336
return osn->serialized == NULL
336337
&& _rawstring_is_clear(&osn->modname)
337338
&& _rawstring_is_clear(&osn->clsname);
338339
}
340+
#endif
339341

340342
static void
341343
_objsnapshot_summarize(_objsnapshot *osn, _rawstring *rawbuf, const char *msg)
@@ -597,13 +599,15 @@ _tbsnapshot_free(_tbsnapshot *tbs)
597599
PyMem_Free(tbs);
598600
}
599601

602+
#ifndef NDEBUG
600603
static int
601604
_tbsnapshot_is_clear(_tbsnapshot *tbs)
602605
{
603606
return tbs->tbs_lineno == -1 && tbs->tbs_next == NULL
604607
&& _rawstring_is_clear(&tbs->tbs_funcname)
605608
&& _rawstring_is_clear(&tbs->tbs_filename);
606609
}
610+
#endif
607611

608612
static int
609613
_tbsnapshot_from_pytb(_tbsnapshot *tbs, PyTracebackObject *pytb)
@@ -748,6 +752,7 @@ _excsnapshot_free(_excsnapshot *es)
748752
PyMem_Free(es);
749753
}
750754

755+
#ifndef NDEBUG
751756
static int
752757
_excsnapshot_is_clear(_excsnapshot *es)
753758
{
@@ -758,6 +763,7 @@ _excsnapshot_is_clear(_excsnapshot *es)
758763
&& es->es_msg == NULL
759764
&& _objsnapshot_is_clear(&es->es_object);
760765
}
766+
#endif
761767

762768
static PyObject *
763769
_excsnapshot_get_exc_naive(_excsnapshot *es)
@@ -1085,13 +1091,15 @@ _sharedexception_free(_sharedexception *she)
10851091
PyMem_Free(she);
10861092
}
10871093

1094+
#ifndef NDEBUG
10881095
static int
10891096
_sharedexception_is_clear(_sharedexception *she)
10901097
{
10911098
return 1
10921099
&& _excsnapshot_is_clear(&she->snapshot)
10931100
&& _rawstring_is_clear(&she->msg);
10941101
}
1102+
#endif
10951103

10961104
static PyObject *
10971105
_sharedexception_get_cause(_sharedexception *sharedexc)

0 commit comments

Comments
 (0)