mirror of
https://github.com/python/cpython
synced 2024-09-05 08:17:45 +00:00
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.
This commit is contained in:
parent
45d5cab533
commit
a816cd67f4
|
@ -1551,6 +1551,7 @@ get_core_module_dict(PyInterpreterState *interp,
|
|||
return NULL;
|
||||
}
|
||||
|
||||
#ifndef NDEBUG
|
||||
static inline int
|
||||
is_core_module(PyInterpreterState *interp, PyObject *name, PyObject *path)
|
||||
{
|
||||
|
@ -1568,7 +1569,6 @@ is_core_module(PyInterpreterState *interp, PyObject *name, PyObject *path)
|
|||
}
|
||||
|
||||
|
||||
#ifndef NDEBUG
|
||||
static _Py_ext_module_kind
|
||||
_get_extension_kind(PyModuleDef *def, bool check_size)
|
||||
{
|
||||
|
|
|
@ -584,9 +584,9 @@ free_interpreter(PyInterpreterState *interp)
|
|||
PyMem_RawFree(interp);
|
||||
}
|
||||
}
|
||||
|
||||
#ifndef NDEBUG
|
||||
static inline int check_interpreter_whence(long);
|
||||
|
||||
#endif
|
||||
/* Get the interpreter state to a minimal consistent state.
|
||||
Further init happens in pylifecycle.c before it can be used.
|
||||
All fields not initialized here are expected to be zeroed out,
|
||||
|
@ -1130,7 +1130,7 @@ _PyInterpreterState_IsReady(PyInterpreterState *interp)
|
|||
return interp->_ready;
|
||||
}
|
||||
|
||||
|
||||
#ifndef NDEBUG
|
||||
static inline int
|
||||
check_interpreter_whence(long whence)
|
||||
{
|
||||
|
@ -1142,6 +1142,7 @@ check_interpreter_whence(long whence)
|
|||
}
|
||||
return 0;
|
||||
}
|
||||
#endif
|
||||
|
||||
long
|
||||
_PyInterpreterState_GetWhence(PyInterpreterState *interp)
|
||||
|
|
Loading…
Reference in a new issue