-
-
Notifications
You must be signed in to change notification settings - Fork 18.1k
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
Compiled pandas with -Wextra #56327
Compiled pandas with -Wextra #56327
Conversation
@@ -56,9 +56,11 @@ PyObject *JSONToObj(PyObject *self, PyObject *args, PyObject *kwargs); | |||
"encode_html_chars=True to encode < > & as unicode escape sequences." | |||
|
|||
static PyMethodDef ujsonMethods[] = { | |||
{"ujson_dumps", (PyCFunction)objToJSON, METH_VARARGS | METH_KEYWORDS, | |||
{"ujson_dumps", (PyCFunction)(void (*)(void))objToJSON, |
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.
I find this cast here a bit strange but it is what CPython has in their documentation for functions that accept kwargs
https://docs.python.org/3/extending/extending.html#keyword-parameters-for-extension-functions
@@ -23,3 +23,17 @@ The full license is in the LICENSE file, distributed with this software. | |||
#define isspace_ascii(c) (((c) == ' ') || (((unsigned)(c) - '\t') < 5)) | |||
#define toupper_ascii(c) ((((unsigned)(c) - 'a') < 26) ? ((c) & 0x5f) : (c)) | |||
#define tolower_ascii(c) ((((unsigned)(c) - 'A') < 26) ? ((c) | 0x20) : (c)) | |||
|
|||
#define UNUSED(x) (void)(x) |
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.
Just curious why this is needed
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.
Unused parameters trigger a warning, and there is no cross platform way to silence them. Gcc/clang have an unused attribute. I'm not aware of something for MSVC
Python offers a Py_UNUSED macro for this purpose too. Let me see if we can switch over to that so it's one less thing we manage
Thanks @WillAyd |
Need to merge in #56277 first then make sure this doesn't cause issues on other platforms, but seems to work for gcc