diff mbox

[09/15] Add declaration to python init func

Message ID 20191125052655.22696-10-simon.marchi@efficios.com
State New
Headers show

Commit Message

Simon Marchi Nov. 25, 2019, 5:26 a.m. UTC
When I try to enable -Wmissing-declarations, I get this error:

      CXX    python/python.o
    /home/smarchi/src/binutils-gdb/gdb/python/python.c: In function ‘PyObject* init__gdb_module()’:
    /home/smarchi/src/binutils-gdb/gdb/python/python.c:1582:1: error: no previous declaration for ‘PyObject* init__gdb_module()’ [-Werror=missing-declarations]
     init__gdb_module (void)

Prevent it by providing a declaration just before the definition.


	* python/python.c (init__gdb_module): Add declaration.

Change-Id: I394bc691b7db624708cc4cb2cda28a56ab85a82b
 gdb/python/python.c | 1 +
 1 file changed, 1 insertion(+)
diff mbox


diff --git a/gdb/python/python.c b/gdb/python/python.c
index fd33399318e2..f3e2abe37ac7 100644
--- a/gdb/python/python.c
+++ b/gdb/python/python.c
@@ -1578,6 +1578,7 @@  finalize_python (void *ignore)
 /* This is called via the PyImport_AppendInittab mechanism called
    during initialization, to make the built-in _gdb module known to
    Python.  */
+PyMODINIT_FUNC init__gdb_module (void);
 init__gdb_module (void)