[issue21121] -Werror=declaration-after-statement is added even for extension modules through setup.py

Ned Deily report at bugs.python.org
Wed Apr 2 03:01:51 CEST 2014


Ned Deily added the comment:

It looks like -Werror=declaration-after-statement was added to BASECFLAGS in configure.ac during the 3.4 development cycle by a3559c8c614b and e47806951fb2. Unfortunately, BASECFLAGS propagates through to extension module builds as well.  If -Werror=declaration-after-statement should only be restricted to the build of the interpreter executable itself, one option *might be* to move the test and definition to CFLAGSFORSHARED in configure.ac.

A workaround could be to define CFLAGS before rebuilding a module:

export CFLAGS=$(python3.4 -c 'import sysconfig; print(sysconfig.get_config_var("CFLAGS").replace("-Werror=declaration-after-statement",""))')

(As usual, my brain hurts after trying to sift through the myriad build flags and their interactions in configure.ac, Makefile, and setup.py.)

----------
nosy: +benjamin.peterson, ned.deily

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue21121>
_______________________________________


More information about the Python-bugs-list mailing list