-
-
Notifications
You must be signed in to change notification settings - Fork 7.9k
CLN: explicitly cast (void *) -> (char *) #4524
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
Conversation
When pulling data from from PyArrray_DATA explicitly cast to (char *). Addresses issues raised in matplotlib#4518
78f8317
to
e0da0b1
Compare
Looks correct to me. |
As far as I understand C, there is nothing "unclean" about the existing version here; but the explicit casts don't hurt anything. (In my understanding, the point of having a void pointer is that explicit casts are not needed. Otherwise, to be consistent, you would also need to use a cast with every assignment of NULL.) |
I was wondering why the NULL doesn't need a cast, but I guess that expands to nullptr and is handled specially in C++. |
Must be; but the basic point is that this is C code, not C++. And as C code, it doesn't need the explicit casts. |
I agree that the casts are unnecessary when compiling as C, but if this file is otherwise valid as C++ I don't see the harm in adding the casts. I also agree that the proper fix is to make qhull valid C. |
Yep, this did the trick! Is there a way to force the use of icpc in the build config? Otherwise I think the default build will fail, which includes installs from package managers like pip. CC=icpc python setup.py install |
Given that this change does no harm, I will merge it. But I also merged #4519, so it shouldn't be necessary unless someone really wants to force the compiler to be icpc. |
CLN: explicitly cast (void *) -> (char *)
FYI, this refers to the floating point model (strict IEEE754, denormal handling, etc.) |
When pulling data from from PyArrray_DATA explicitly cast
to (char *).
Addresses issues raised in #4518
@frenchwr does this address the issues of using
icpc
for everything? I was inspried by the `-fp-model strict' which I (maybe wrongly) translated to 'pointer model' given that the exception is about mis-matched pointer types.