This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author AMDmi3
Recipients AMDmi3
Date 2019-04-04.16:08:41
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1554394121.78.0.720691487188.issue36527@roundup.psfhosted.org>
In-reply-to
Content
Python 3.8 and nightly introduces unused (in some cases) parameters in object.h header. This makes compilation of third party code which includes the header fail if it's built with -Werror.

Build log excerpt:

---
g++ -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -g -fstack-protector --param=ssp-buffer-size=4 -Wformat -Werror=format-security -UNDEBUG -Wall -Wextra -Werror -fPIC -I/usr/include/yajl -I/opt/python/3.8-dev/include/python3.8m -c src/construct_handlers.cc -o build/temp.linux-x86_64-3.8/src/construct_handlers.o -std=c++11 -DJSONSLICER_VERSION="0.1.4" -DUSE_BYTES_INTERNALLY -fno-exceptions -fno-rtti
In file included from /opt/python/3.8-dev/include/python3.8m/pytime.h:6:0,
                 from /opt/python/3.8-dev/include/python3.8m/Python.h:85,
                 from src/pyobjlist.hh:26,
                 from src/jsonslicer.hh:26,
                 from src/construct_handlers.hh:26,
                 from src/construct_handlers.cc:23:
/opt/python/3.8-dev/include/python3.8m/object.h:441:50: error: unused parameter ‘op’ [-Werror=unused-parameter]
 static inline void _Py_ForgetReference(PyObject *op)
                                                  ^
/opt/python/3.8-dev/include/python3.8m/object.h:458:43: error: unused parameter ‘filename’ [-Werror=unused-parameter]
 static inline void _Py_DECREF(const char *filename, int lineno,
                                           ^
/opt/python/3.8-dev/include/python3.8m/object.h:458:57: error: unused parameter ‘lineno’ [-Werror=unused-parameter]
 static inline void _Py_DECREF(const char *filename, int lineno,
                                                         ^
---

Full build log:

https://travis-ci.org/AMDmi3/jsonslicer/jobs/515771366

Possible solutions:
- Add (void)param; to silence the warning as it's already done in Include/internal/pycore_atomic.h
- Make distutils list python include directory with -isystem instead of -I. This way, python include won't generate warnings for third party code.
History
Date User Action Args
2019-04-04 16:08:41AMDmi3setrecipients: + AMDmi3
2019-04-04 16:08:41AMDmi3setmessageid: <1554394121.78.0.720691487188.issue36527@roundup.psfhosted.org>
2019-04-04 16:08:41AMDmi3linkissue36527 messages
2019-04-04 16:08:41AMDmi3create