DEV: Add static modifier to inline declarations. #12123
Closed
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
It is currently impossible to build a debug version of Pandas on Mac OS, since some of the C function declarations are declared as
inline
, and compiling in debug mode turns off optimizations and hence inlining. While this could be solved by adding a compile argument tosetup.py
to use the C89 behavior for inline as in #10510, I believe an ultimately cleaner solution may consist of declaring inlined functions asstatic
, so that the code is properly C99-compliant.For the implementation, I added the
static
keyword to the definitions ofPANDAS_INLINE
andP_INLINE
(and removed duplicate occurrences ofstatic
from some function declarations), so that future implementations that use those defines are automatically compliant. This is slightly different from e.g. Cython, which definesCYTHON_INLINE
asinline
and declares everything asstatic CYTHON_INLINE
.