Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DEV: Add static modifier to inline declarations. #12123

Closed
wants to merge 2 commits into from

Conversation

jvkersch
Copy link

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 to setup.py to use the C89 behavior for inline as in #10510, I believe an ultimately cleaner solution may consist of declaring inlined functions as static, so that the code is properly C99-compliant.

For the implementation, I added the static keyword to the definitions of PANDAS_INLINE and P_INLINE (and removed duplicate occurrences of static from some function declarations), so that future implementations that use those defines are automatically compliant. This is slightly different from e.g. Cython, which defines CYTHON_INLINE as inline and declares everything as static CYTHON_INLINE.

@jvkersch
Copy link
Author

I think this provides an alternative solution for #10510, but I haven't tested this yet (currently downloading a FreeBSD vm over crummy internet).

@wesm
Copy link
Member

wesm commented Jan 24, 2016

Makes sense to me. Reviewed lgtm if the build passes.

@jvkersch
Copy link
Author

I ended up removing the conditional flag -fgnu89-inline on FreeBSD, since the addition of static makes it unnecessary. Building succeeds on my copy of FreeBSD 10.2, and the tests more or less run (there are some failures but they don't look related).

@jreback
Copy link
Contributor

jreback commented Jan 24, 2016

pls add a whatsnew note
and comment on that other issue for them to try this PR (just to confirm)

@jvkersch
Copy link
Author

Done. Thanks guys for the quick feedback.

@jreback jreback added the Compat pandas objects compatability with Numpy or Python functions label Jan 24, 2016
@jreback jreback added this to the 0.18.0 milestone Jan 24, 2016
@jreback jreback closed this in b26fac8 Jan 24, 2016
@jreback
Copy link
Contributor

jreback commented Jan 24, 2016

@jvkersch thank you sir!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Compat pandas objects compatability with Numpy or Python functions
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants