[issue32563] -Werror=declaration-after-statement expat build failure on Python 3.5

Nick Coghlan report at bugs.python.org
Tue Jan 16 00:50:40 EST 2018


Nick Coghlan <ncoghlan at gmail.com> added the comment:

Details of the compilation failure:

```
building 'pyexpat' extension
gcc -pthread -fPIC -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -Werror=declaration-after-statement -DHAVE_EXPAT_CONFIG_H=1 -DXML_POOR_ENTROPY=1 -DUSE_PYEXPAT_CAPI -I/home/ncoghlan/devel/py35/Modules/expat -I./Include -I. -I/usr/local/include -I/home/ncoghlan/devel/py35/Include -I/home/ncoghlan/devel/py35 -c /home/ncoghlan/devel/py35/Modules/pyexpat.c -o build/temp.linux-x86_64-3.5/home/ncoghlan/devel/py35/Modules/pyexpat.o
gcc -pthread -fPIC -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -Werror=declaration-after-statement -DHAVE_EXPAT_CONFIG_H=1 -DXML_POOR_ENTROPY=1 -DUSE_PYEXPAT_CAPI -I/home/ncoghlan/devel/py35/Modules/expat -I./Include -I. -I/usr/local/include -I/home/ncoghlan/devel/py35/Include -I/home/ncoghlan/devel/py35 -c /home/ncoghlan/devel/py35/Modules/expat/xmlparse.c -o build/temp.linux-x86_64-3.5/home/ncoghlan/devel/py35/Modules/expat/xmlparse.o
gcc -pthread -fPIC -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -Werror=declaration-after-statement -DHAVE_EXPAT_CONFIG_H=1 -DXML_POOR_ENTROPY=1 -DUSE_PYEXPAT_CAPI -I/home/ncoghlan/devel/py35/Modules/expat -I./Include -I. -I/usr/local/include -I/home/ncoghlan/devel/py35/Include -I/home/ncoghlan/devel/py35 -c /home/ncoghlan/devel/py35/Modules/expat/xmlrole.c -o build/temp.linux-x86_64-3.5/home/ncoghlan/devel/py35/Modules/expat/xmlrole.o
gcc -pthread -fPIC -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -Werror=declaration-after-statement -DHAVE_EXPAT_CONFIG_H=1 -DXML_POOR_ENTROPY=1 -DUSE_PYEXPAT_CAPI -I/home/ncoghlan/devel/py35/Modules/expat -I./Include -I. -I/usr/local/include -I/home/ncoghlan/devel/py35/Include -I/home/ncoghlan/devel/py35 -c /home/ncoghlan/devel/py35/Modules/expat/xmltok.c -o build/temp.linux-x86_64-3.5/home/ncoghlan/devel/py35/Modules/expat/xmltok.o
/home/ncoghlan/devel/py35/Modules/expat/xmltok.c: In function ‘utf8_toUtf8’:
/home/ncoghlan/devel/py35/Modules/expat/xmltok.c:408:3: error: ISO C90 forbids mixed declarations and code [-Werror=declaration-after-statement]
   const char * const fromLimBefore = fromLim;
   ^~~~~
/home/ncoghlan/devel/py35/Modules/expat/xmltok.c:414:3: error: ISO C90 forbids mixed declarations and code [-Werror=declaration-after-statement]
   const ptrdiff_t bytesToCopy = fromLim - *fromP;
   ^~~~~
cc1: some warnings being treated as errors
```

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue32563>
_______________________________________


More information about the Python-bugs-list mailing list