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

Compiled pandas with -Wextra #56327

Merged
merged 16 commits into from
Dec 9, 2023
Merged

Compiled pandas with -Wextra #56327

merged 16 commits into from
Dec 9, 2023

Conversation

WillAyd
Copy link
Member

@WillAyd WillAyd commented Dec 4, 2023

Need to merge in #56277 first then make sure this doesn't cause issues on other platforms, but seems to work for gcc

@@ -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,
Copy link
Member Author

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

@mroeschke mroeschke added the Build Library building on various platforms label Dec 7, 2023
@@ -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)
Copy link
Member

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

Copy link
Member Author

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

@mroeschke mroeschke added this to the 2.2 milestone Dec 9, 2023
@mroeschke mroeschke merged commit 1ab4d03 into pandas-dev:main Dec 9, 2023
82 checks passed
@mroeschke
Copy link
Member

Thanks @WillAyd

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Build Library building on various platforms
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants