summaryrefslogtreecommitdiffstats
path: root/Python/pystate.c
diff options
context:
space:
mode:
authorKirill Podoprigora <kirill.bast9@mail.ru>2024-06-19 07:46:04 (GMT)
committerGitHub <noreply@github.com>2024-06-19 07:46:04 (GMT)
commita816cd67f43d9adb27ccdb6331e08c835247d1df (patch)
tree7ac99e7aab9d40b599d2b754aa4aa1d40760e577 /Python/pystate.c
parent45d5cab533a607716b2b41134839a59facf309cd (diff)
downloadcpython-a816cd67f43d9adb27ccdb6331e08c835247d1df.zip
cpython-a816cd67f43d9adb27ccdb6331e08c835247d1df.tar.gz
cpython-a816cd67f43d9adb27ccdb6331e08c835247d1df.tar.bz2
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.
Diffstat (limited to 'Python/pystate.c')
-rw-r--r--Python/pystate.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/Python/pystate.c b/Python/pystate.c
index e1a9590..8d31a4d 100644
--- a/Python/pystate.c
+++ b/Python/pystate.c
@@ -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)