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.

classification
Title: [3.4][3.5] pyexpat: compilaton of libexpat fails with: ISO C90 forbids mixed declarations and code
Type: security Stage: resolved
Components: Build Versions: Python 3.4, Python 3.5
process
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: Nosy List: vstinner
Priority: normal Keywords:

Created on 2017-11-07 01:09 by vstinner, last changed 2022-04-11 14:58 by admin. This issue is now closed.

Messages (3)
msg305705 - (view) Author: STINNER Victor (vstinner) * (Python committer) Date: 2017-11-07 01:09
/home/haypo/prog/python/3.5/Modules/expat/xmltok.c: In function 'utf8_toUtf8':
/home/haypo/prog/python/3.5/Modules/expat/xmltok.c:408:3: error: ISO C90 forbids mixed declarations and code [-Werror=declaration-after-statement]
   const char * const fromLimBefore = fromLim;
   ^~~~~
/home/haypo/prog/python/3.5/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
*** WARNING: renaming "_elementtree" since importing it failed: PyCapsule_Import could not import module "pyexpat"


It's probably a regression caused by:

* Python 3.5: commit f2492bb6aae061aea47e21fc7e56b7ab9bfdf543
* Python 3.4: commit 86a713cb0c110b6798ca7f9e630fc511ee0a4028


I don't understand why the issue wasn't catched before. Maybe test_xml_etree is simply skipped if pyexpat compilation fails on Linux. Or buildbots and Travis CI uses ./configure --with-system-expat on Linux.
msg305706 - (view) Author: STINNER Victor (vstinner) * (Python committer) Date: 2017-11-07 01:13
Python 3.6 is not affected since it uses ISO C99 which allows "mixed declarations and code".

Python 2.7 is not affected since it doesn't use -Werror=declaration-after-statement.
msg308403 - (view) Author: STINNER Victor (vstinner) * (Python committer) Date: 2017-12-15 15:17
The bug has been fixed by commit 8b11e8de7aedacfbbcc8c780f3c4097396f1d1a3 in Python 3.4
History
Date User Action Args
2022-04-11 14:58:54adminsetgithub: 76145
2017-12-15 15:17:50vstinnersetstatus: open -> closed
resolution: fixed
messages: + msg308403

stage: resolved
2017-11-07 01:13:04vstinnersetmessages: + msg305706
2017-11-07 01:09:44vstinnercreate