You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
The text was updated successfully, but these errors were encountered:
javaprog
added a commit
to javaprog/py3c
that referenced
this issue
Jan 26, 2021
By marking the static function "inline", the compiler will only generate code for it if it is actually used. Without the keyword, the compiler will emit a warning if it is not used. For trivial Python C bindings this is not an issue, but if the code consists of multiple compilation units then this currently results in a warning for each such compilation unit without module initialization function.
Fixes: #40 (for GCC)
Making the functions `inline` would be better here, but `inline` is
not available in C90.
Includes tests to avoid future regressions :)
PyModule_Create
in compat.h is declared asstatic
but not marked asinline
. 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 keywordinline
will discard the function in compilation units that don't use it.The text was updated successfully, but these errors were encountered: