Skip to content

gh-107279 Add <stddef.h> to Modules/zlibmodule.c to fix failing builds #107280

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

Merged
merged 1 commit into from
Jul 27, 2023

Conversation

shailshouryya
Copy link
Contributor

@shailshouryya shailshouryya commented Jul 26, 2023

See the message in commit 733d38c for a quick overview.

Essentially, it looks like #106871 updated some internal C implementations, but missed adding <stddef.h> to the Modules/zlibmodule.c file. I noticed this when looking at the output of the build after commit fabcbe9 was merged, and the following 2 commits (6a43cce and 2b1a81e) also failed with the same error.

Interestingly, not all platforms seem to fail because of this omission. In commit 2b1a81e, for example:

This seems a odd to me, but I'm not familiar enough with the CI/build process to offer a suggestion for this discrepancy between platforms.

Recent CI builds are failing because the `offsetof` function in
`Modules/zlibmodule.c` cannot be called. For example, see
https://buildbot.python.org/all/#/builders/15/builds/5217/steps/4/logs/stdio
from commit fabcbe9. Here is a relevant
snippet from the stdio logs for step 4 compile:

```
../Modules/zlibmodule.c:1802:21: error: implicit declaration of function ‘offsetof’ [-Werror=implicit-function-declaration]
 #define COMP_OFF(x) offsetof(compobject, x)
                     ^~~~~~~~
../Modules/zlibmodule.c:1804:39: note: in expansion of macro ‘COMP_OFF’
     {"unused_data",     _Py_T_OBJECT, COMP_OFF(unused_data), Py_READONLY},
                                       ^~~~~~~~
../Modules/zlibmodule.c:1802:21: note: ‘offsetof’ is defined in header ‘<stddef.h>’; did you forget to ‘#include <stddef.h>’?
../Modules/zlibmodule.c:1776:1:
+#include <stddef.h>

../Modules/zlibmodule.c:1802:21:
 #define COMP_OFF(x) offsetof(compobject, x)
                     ^~~~~~~~
../Modules/zlibmodule.c:1804:39: note: in expansion of macro ‘COMP_OFF’
     {"unused_data",     _Py_T_OBJECT, COMP_OFF(unused_data), Py_READONLY},
                                       ^~~~~~~~
../Modules/zlibmodule.c:1802:30: error: expected expression before ‘compobject’
 #define COMP_OFF(x) offsetof(compobject, x)
                              ^~~~~~~~~~
```
@shailshouryya
Copy link
Contributor Author

I think the skip-news label should apply to this PR, but I can't add/modify labels here. Can someone else add that label for me?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants