10000 gh-120726: Fix compiler warnings on is_core_module() (#120727) · python/cpython@a816cd6 · GitHub
[go: up one dir, main page]

Skip to content

Commit a816cd6

Browse files
authored
gh-120726: Fix compiler warnings on is_core_module() (#120727)
Fix compiler warnings on is_core_module() and check_interpreter_whence(): only define them when assertions are built.
1 parent 45d5cab commit a816cd6

File tree

2 files changed

+5
-4
lines changed

2 files changed

+5
-4
lines changed

Python/import.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1551,6 +1551,7 @@ get_core_module_dict(PyInterpreterState *interp,
15511551
return NULL;
15521552
}
15531553

1554+
#ifndef NDEBUG
15541555
static inline int
15551556
is_core_module(PyInterpreterState *interp, PyObject *name, PyObject *path)
15561557
{
@@ -1568,7 +1569,6 @@ is_core_module(PyInterpreterState *interp, PyObject *name, PyObject *path)
15681569
}
15691570

15701571

1571-
#ifndef NDEBUG
15721572
static _Py_ext_module_kind
15731573
_get_extension_kind(PyModuleDef *def, bool check_size)
15741574
{

Python/pystate.c

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -584,9 +584,9 @@ free_interpreter(PyInterpreterState *interp)
584584
PyMem_RawFree(interp);
585585
}
586586
}
587-
587+
#ifndef NDEBUG
588588
static inline int check_interpreter_whence(long);
589-
589+
#endif
590590
/* Get the interpreter state to a minimal consistent state.
591591
Further init happens in pylifecycle.c before it can be used.
592592
All fields not initialized here are expected to be zeroed out,
@@ -1130,7 +1130,7 @@ _PyInterpreterState_IsReady(PyInterpreterState *interp)
11301130
return interp->_ready;
11311131
}
11321132

1133-
1133+
#ifndef NDEBUG
11341134
static inline int
11351135
check_interpreter_whence(long whence)
11361136
{
@@ -1142,6 +1142,7 @@ check_interpreter_whence(long whence)
11421142
}
11431143
return 0;
11441144
}
1145+
#endif
11451146

11461147
long
11471148
_PyInterpreterState_GetWhence(PyInterpreterState *interp)

0 commit comments

Comments
 (0)
0