encukou / py3c

A Python 2/3 compatibility layer for C extensions
http://py3c.readthedocs.org
MIT License
59 stars 20 forks source link

Avoid compiler warning about unused function #40

Closed javaprog closed 3 years ago

javaprog commented 3 years ago

PyModule_Create in compat.h is declared as static but not marked as inline. As a consequence, for complex Python C bindings consisting of multiple compilation units, the compiler will emit a warning about the function being unused (except for the compilation unit that actually uses it). Adding the keyword inline will discard the function in compilation units that don't use it.