Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork10.9k
BUG: Avoid compile errors in f2py modules#29034
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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
base:main
Are you sure you want to change the base?
Conversation
Some of the casts from cfuncs pass PyObject* to PyArrayObject*, whichcauses compile errors due to incompatible pointer types on at leastGCC 14.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
LGTM, could you look into adding a test, though? Since looks a bit like we are not hitting this code in our test suite at all.
Which I guess is not too weird considering that it is longdouble (and there are even thoughts to move support for it out of NumPy proper).
Done, I've just done this by extending the assumption that real/complex kinds map to bit widths (I'm only familiar with GNU and Intel compilers where this does indeed hold). |
Let's see, sorry, yeah this is longdouble, which means it's a platform dependent mess. So there is a good chance CI will barf at this and we can't integrate this into a test for all platforms. |
😁 Well that'll be fun to see. Surely tests can be targeted to supported platforms, at least? |
I am not sure it worries me less that the tests seem to pass... they seem to pass on windows, but windows has no real longdouble support in NumPy. So how come Maybe@HaoZeke has a quick thought, but not sure it's wise to do this test. I wonder what happens if you do some trivial set of math and check the result (but not sure the tests can be changed to do that easily). Unless it compiles, but we skip the actual tests for |
The I also realised that I didn't add the actual function checks to |
Yeah, basically, I am happy to put this in as it is a clear fix (if it works for you!); maybe without the tests if they are just dubious anyway... |
I've hit a couple of compile errors when using
f2py -c ...
:Following some of the other uses of this API in the cfuncs file, this just uses an explicit pointer cast, as we've already validated it upon use.