8000 [3.13] gh-120726: Fix compiler warnings on is_core_module() (GH-120727) by miss-islington · Pull Request #120729 · python/cpython · GitHub
[go: up one dir, main page]

Skip to content

[3.13] gh-120726: Fix compiler warnings on is_core_module() (GH-120727) #120729

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jun 19, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
gh-120726: Fix compiler warnings on is_core_module() (GH-120727)
Fix compiler warnings on is_core_module() and
check_interpreter_whence(): only define them when
assertions are built.
(cherry picked from commit a816cd6)

Co-authored-by: Kirill Podoprigora <kirill.bast9@mail.ru>
  • Loading branch information
Eclips4 authored and miss-islington committed Jun 19, 2024
commit 9bd95488f8bec8472ce21ecebfb3bebcf93ea014
2 changes: 1 addition & 1 deletion Python/import.c
Original file line number Diff line number Diff line change
Expand Up @@ -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)
{
Expand All @@ -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)
{
Expand Down
7 changes: 4 additions & 3 deletions Python/pystate.c
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -1130,7 +1130,7 @@ _PyInterpreterState_IsReady(PyInterpreterState *interp)
return interp->_ready;
}


#ifndef NDEBUG
static inline int
check_interpreter_whence(long whence)
{
Expand All @@ -1142,6 +1142,7 @@ check_interpreter_whence(long whence)
}
return 0;
}
#endif

long
_PyInterpreterState_GetWhence(PyInterpreterState *interp)
Expand Down
Loading
0