-
-
Notifications
You must be signed in to change notification settings - Fork 18k
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
objToJSON nonvoid function does not return a value #5326
Comments
we can't do anything for 0.12, but for 0.13? |
Linked issue says that the import_arrays macro causes a return to be |
On Fri, Oct 25, 2013 at 11:01 PM, Jeff Tratner notifications@git.luolix.topwrote:
This is a post-build check implemented in openSUSE's build system. It is a There is also a compile warning regarding this: pandas/src/ujson/python/objToJSON.c:166:1: warning: control reaches |
Okay, that's helpful context - I thought you were saying it refused to compile. I think the idea from the other PR was that there was an import_arrays() macro that magically inserted a return value... |
I just pushed a branch that should fix this warning for both the compile check and for clang, I'm still not totally clear, but I'll put up a PR and wait for @cpcloud or @Komnomnomnom to comment. |
But the problem is that when you do that, get the opposite error from gcc about returning void from function with int, b/c of issues with what import_array() expands to... |
So I'm not sure where the right direction is with this (line numbers are 10 off b/c of versioning) |
And here's the macro definition:
And this is the definition of the retval:
So there's the problem. Maybe this is different in different versions of numpy? |
@jratner this needs testing in windows |
@toddrme2178 I looked at it again and the compiler's right (obviously!) in the case where it doesn't raise an error, you still get to the end of the function. I changed the function to return the same import array retval right afterwards, so that the function signature is always correct. Certainly a little bit clunky - I think functions are supposed to return different things if they can raise exceptions in Python 2 and Python 3? Anyways, I have a PR up, please take a look. |
I am trying to package pandas 0.12.0 for openSUSE with python 3 the build fails with the following error:
E: python3-pandas no-return-in-nonvoid-function pandas/src/ujson/python/objToJSON.c:166
I think this may be related to pull request #3874, where the return type was changed to int but the rest of the function remains the same, so no int was actually returned.
The text was updated successfully, but these errors were encountered: