bpo-28411: Fix redundant declaration of _PyImport_AddModuleObject by jeremycline · Pull Request #7992 · python/cpython
Commit 3f9eee6 ("bpo-28411: Support other mappings in PyInterpreterState.modules.") introduced a new warning when building a C extension with GCC and Python 3.7: In file included from /usr/include/python3.7m/Python.h:126, from /home/me/linux/packaging/tools/perf/util/python.c:2: /usr/include/python3.7m/import.h:58:24: error: redundant redeclaration of ‘_PyImport_AddModuleObject’ [-Werror=redundant-decls] PyAPI_FUNC(PyObject *) _PyImport_AddModuleObject(PyObject *, PyObject *); ^~~~~~~~~~~~~~~~~~~~~~~~~ /usr/include/python3.7m/import.h:47:24: note: previous declaration of ‘_PyImport_AddModuleObject’ was here PyAPI_FUNC(PyObject *) _PyImport_AddModuleObject(PyObject *name, ^~~~~~~~~~~~~~~~~~~~~~~~~ cc1: all warnings being treated as errors error: command 'gcc' failed with exit status 1 Both _PyImport_AddModuleObject declarations are within #ifndef Py_LIMITED_API conditional block so drop one of them. Signed-off-by: Jeremy Cline <jeremy@jcline.org>
jeremycline
changed the title
Fix redundant declaration of _PyImport_AddModuleObject
bpo-28411: Fix redundant declaration of _PyImport_AddModuleObject
miss-islington pushed a commit to miss-islington/cpython that referenced this pull request
(cherry picked from commit f874bd1) Co-authored-by: Jeremy Cline <jeremy@jcline.org>
miss-islington added a commit that referenced this pull request
(cherry picked from commit f874bd1) Co-authored-by: Jeremy Cline <jeremy@jcline.org>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters