Closed
Description
Bug report
Commits fabcbe9, 6a43cce, and 2b1a81e (and likely other commits) are failing during the build step with the following error:
../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)
^~~~~~~~~~
../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)
^~~~~~~~~~
../Modules/zlibmodule.c:1805:39: note: in expansion of macro ‘COMP_OFF’
{"unconsumed_tail", _Py_T_OBJECT, COMP_OFF(unconsumed_tail), Py_READONLY},
^~~~~~~~
../Modules/zlibmodule.c:1802:30: error: expected expression before ‘compobject’
#define COMP_OFF(x) offsetof(compobject, x)
^~~~~~~~~~
../Modules/zlibmodule.c:1806:38: note: in expansion of macro ‘COMP_OFF’
{"eof", Py_T_BOOL, COMP_OFF(eof), Py_READONLY},
^~~~~~~~
../Modules/zlibmodule.c:1820:33: error: expected expression before ‘ZlibDecompressor’
{"eof", Py_T_BOOL, offsetof(ZlibDecompressor, eof),
^~~~~~~~~~~~~~~~
../Modules/zlibmodule.c:1820:24: error: initializer element is not constant
{"eof", Py_T_BOOL, offsetof(ZlibDecompressor, eof),
^~~~~~~~
../Modules/zlibmodule.c:1820:24: note: (near initialization for ‘ZlibDecompressor_members[0].offset’)
../Modules/zlibmodule.c:1822:46: error: expected expression before ‘ZlibDecompressor’
{"unused_data", Py_T_OBJECT_EX, offsetof(ZlibDecompressor, unused_data),
^~~~~~~~~~~~~~~~
../Modules/zlibmodule.c:1822:37: error: initializer element is not constant
{"unused_data", Py_T_OBJECT_EX, offsetof(ZlibDecompressor, unused_data),
^~~~~~~~
../Modules/zlibmodule.c:1822:37: note: (near initialization for ‘ZlibDecompressor_members[1].offset’)
../Modules/zlibmodule.c:1824:41: error: expected expression before ‘ZlibDecompressor’
{"needs_input", Py_T_BOOL, offsetof(ZlibDecompressor, needs_input), Py_READONLY,
^~~~~~~~~~~~~~~~
../Modules/zlibmodule.c:1824:32: error: initializer element is not constant
{"needs_input", Py_T_BOOL, offsetof(ZlibDecompressor, needs_input), Py_READONLY,
^~~~~~~~
../Modules/zlibmodule.c:1824:32: note: (near initialization for ‘ZlibDecompressor_members[2].offset’)
cc1: some warnings being treated as errors
make: *** [Makefile:2998: Modules/zlibmodule.o] Error 1
Your environment
This is occurring in the python/cpython CICD pipeline. Clicking on the ❌ icon in the commits linked to above and checking the logs for the failing builds shows the error. Examples:
- https://buildbot.python.org/all/#/builders/15/builds/5217/steps/4/logs/stdio
- https://buildbot.python.org/all/#/builders/15/builds/5219/steps/4/logs/stdio