bpo-32390: Modify syntax to satisify xlC/gcc compiler requirements on AIX: assignment between types "unsigned long" and "struct fsid_t" is not allowed by aixtools · Pull Request #4972 · python/cpython (original) (raw)
Seems 'clang' and AIX xlc and gcc are not agreeing:
- The clang test (of ontinuous-integration/travis-ci/pr) fails with:
./Modules/posixmodule.c:9328:71: error: member reference base type 'unsigned long' is not a structure or union
PyStructSequence_SET_ITEM(v, 10, PyLong_FromUnsignedLong(st.f_fsid.val[0]));
~~~~~~~~~^~~~
./Include/structseq.h:38:69: note: expanded from macro 'PyStructSequence_SET_ITEM'
#define PyStructSequence_SET_ITEM(op, i, v) PyTuple_SET_ITEM(op, i, v)
^
./Include/tupleobject.h:62:75: note: expanded from macro 'PyTuple_SET_ITEM'
#define PyTuple_SET_ITEM(op, i, v) (((PyTupleObject *)(op))->ob_item[i] = v)
^
- While the AIX buildbot (e.g., http://buildbot.python.org/all/#/builders/10/builds/417)
fails with:
gcc -pthread -Wno-unused-result -Wsign-compare -g -Og -Wall -Wstrict-prototypes -std=c99 -Wextra -Wno-unused-result -Wno-unused-parameter -Wno-missing-field-initializers -Werror=implicit-function-declaration -I. -I./Include -DPy_BUILD_CORE -c ./Modules/posixmodule.c -o Modules/posixmodule.o
In file included from ./Include/Python.h:85:0,
from ./Modules/posixmodule.c:27:
./Modules/posixmodule.c: In function '_pystatvfs_fromstructstatvfs':
./Modules/posixmodule.c:9328:62: error: incompatible type for argument 1 of 'PyLong_FromUnsignedLong'
PyStructSequence_SET_ITEM(v, 10, PyLong_FromUnsignedLong(st.f_fsid));
^
./Include/tupleobject.h:62:75: note: in definition of macro 'PyTuple_SET_ITEM'
#define PyTuple_SET_ITEM(op, i, v) (((PyTupleObject *)(op))->ob_item[i] = v)
^
./Modules/posixmodule.c:9328:5: note: in expansion of macro 'PyStructSequence_SET_ITEM'
PyStructSequence_SET_ITEM(v, 10, PyLong_FromUnsignedLong(st.f_fsid));
^~~~~~~~~~~~~~~~~~~~~~~~~
In file included from ./Include/Python.h:78:0,
from ./Modules/posixmodule.c:27:
./Include/longobject.h:19:24: note: expected 'long unsigned int' but argument is of type 'fsid_t {aka struct fsid_t}'
PyAPI_FUNC(PyObject *) PyLong_FromUnsignedLong(unsigned long);
^~~~~~~~~~~~~~~~~~~~~~~
Makefile:1765: recipe for target 'Modules/posixmodule.o' failed
- I'll modify the change (to put it behind _AIX) - as AIX seems to be having an issue regardless of gcc or xlc (which is how I spotted the issue originally).
- See if that passes tests - and then I welcome your input for a potentially prettier solution!