Issue 4558: ./configure --with-stdc89 to test ANSI C conformity (original) (raw)

Issue4558

Created on 2008-12-06 02:25 by christian.heimes, last changed 2022-04-11 14:56 by admin. This issue is now closed.

Files
File name Uploaded Description Edit
with_stdc89.patch christian.heimes,2008-12-06 02:25
with_stdc89_2.patch christian.heimes,2008-12-06 09:23
python-trunk-20081209-c89.patch rpetrov,2008-12-08 23:46 updated c89 patch for linux
python3-20110520-c89.patch rpetrov,2011-05-19 22:05 update review
with_stdc89_3.patch christian.heimes,2013-06-24 14:08 review
with_stdc89_3.patch christian.heimes,2013-06-24 14:09 review
Messages (16)
msg77097 - (view) Author: Christian Heimes (christian.heimes) * (Python committer) Date: 2008-12-06 02:25
The patch adds a configure option --with-stdc89. It also fixes some edge cases in socketmodule.h and linuxaudiodev so all related modules can be build in c89 mode. I'm planning to add the configure option to the build bots in order to detect c89 incompatibilities like the usage of "inline" and // style comments.
msg77102 - (view) Author: Georg Brandl (georg.brandl) * (Python committer) Date: 2008-12-06 08:08
Patch looks good.
msg77106 - (view) Author: Christian Heimes (christian.heimes) * (Python committer) Date: 2008-12-06 09:23
The updated patch moves the compiler option to the right place.
msg77141 - (view) Author: Roumen Petrov (rpetrov) * Date: 2008-12-06 16:17
There is no reason to overload configure script. Please look into pyport.h : #define Py_LOCAL(type) static type #define Py_LOCAL_INLINE(type) static inline type Someone add USE_INLINE - not finished. I guess that other source files has to use macros from one header(pyport.h) instead every C-file to resolve issue independently.
msg77144 - (view) Author: Christian Heimes (christian.heimes) * (Python committer) Date: 2008-12-06 16:47
I think you don't get the point of the patch. The configure option *enforces* the C89 standard. Every non C89 conform C feature like // comments and the "inline" keyword will cause a compiler error. The patch is meant for testing the Python code on the build bots.
msg77146 - (view) Author: Roumen Petrov (rpetrov) * Date: 2008-12-06 16:52
Christian did you like to propose a separate configure flag for every dialect that GCC support? I prefer variables like OPT.
msg77148 - (view) Author: Roumen Petrov (rpetrov) * Date: 2008-12-06 16:53
P.S. About C++ comments ( // ) I think that another issue is already opened (problem on AIX ? ) .
msg77149 - (view) Author: Christian Heimes (christian.heimes) * (Python committer) Date: 2008-12-06 16:55
Python core code must be compliant with the C89 standard but we don't have any checks for C89 compatibility. This patch adds a clean way to check our code base. You can verify my patch by adding a // comment somewhere in the code and ./configure --with-stdc89 && make.
msg77156 - (view) Author: Roumen Petrov (rpetrov) * Date: 2008-12-06 18:19
make EXTRA_CFLAGS='-std=c89' works for me.
msg77240 - (view) Author: Roumen Petrov (rpetrov) * Date: 2008-12-07 18:47
:-( the last my comment is incomplete : work for me after "minimal patch"
msg77369 - (view) Author: Roumen Petrov (rpetrov) * Date: 2008-12-08 23:46
Socket module need to be patched too otherwise test_socket fail on UNIX domain socket tests. After clean build and with new patch the regression tests results are: 337 tests OK. 3 tests failed: test_curses test_urllib2_localnet test_urllibnet 21 tests skipped: test_aepack test_al test_applesingle test_bsddb185 test_cd test_cl test_gl test_imgfile test_kqueue test_macos test_macostools test_pep277 test_py3kwarn test_scriptpackages test_sqlite test_startfile test_sunaudiodev test_unicode_file test_winreg test_winsound test_zipfile64 Those skips are all expected on linux2. Interesting for failed tests is that every succeed if run independently.
msg136338 - (view) Author: Roumen Petrov (rpetrov) * Date: 2011-05-19 22:05
Issue with inline was resolved by configure macro.
msg136413 - (view) Author: STINNER Victor (vstinner) * (Python committer) Date: 2011-05-21 00:15
Is it still useful to ensure that ISO C89 compilers are supported in 2011?
msg136438 - (view) Author: Amaury Forgeot d'Arc (amaury.forgeotdarc) * (Python committer) Date: 2011-05-21 13:33
Yes, vs2008 requires that variables must be declared at the start of a block, and IIRC there is a AIX compiler that does not allow // comments.
msg191765 - (view) Author: Christian Heimes (christian.heimes) * (Python committer) Date: 2013-06-24 14:08
Updated patch for Python 3.4. The feature is still useful. For example I found a bug in pymacro.h and fixed it in r84306.
msg191766 - (view) Author: Christian Heimes (christian.heimes) * (Python committer) Date: 2013-06-24 14:09
Make that r6915dfddb3f6
History
Date User Action Args
2022-04-11 14:56:42 admin set github: 48808
2016-09-10 21:28:25 christian.heimes set status: open -> closedresolution: out of datestage: patch review -> resolved
2013-06-24 14:09:26 christian.heimes set files: + with_stdc89_3.patchmessages: +
2013-06-24 14:08:46 christian.heimes set files: + with_stdc89_3.patchtitle: with_stdc89 -> ./configure --with-stdc89 to test ANSI C conformitymessages: + versions: + Python 3.3, Python 3.4, - Python 3.2
2011-05-21 13:33:11 amaury.forgeotdarc set nosy: + amaury.forgeotdarcmessages: +
2011-05-21 00:15:04 vstinner set nosy: + vstinnermessages: +
2011-05-19 22:05:50 rpetrov set files: + python3-20110520-c89.patchmessages: +
2010-08-03 21:26:37 terry.reedy link issue6558 superseder
2010-07-10 06:11:33 terry.reedy set keywords:patch, patchversions: + Python 3.2, - Python 2.6, Python 3.0, Python 3.1, Python 2.7
2008-12-08 23:46:24 rpetrov set files: - python-trunk-20081206-c89.patch
2008-12-08 23:46:16 rpetrov set files: + python-trunk-20081209-c89.patchmessages: +
2008-12-07 18:47:00 rpetrov set messages: +
2008-12-06 18:19:20 rpetrov set files: + python-trunk-20081206-c89.patchmessages: +
2008-12-06 16:55:51 christian.heimes set keywords:patch, patchmessages: +
2008-12-06 16:53:33 rpetrov set messages: +
2008-12-06 16:52:10 rpetrov set messages: +
2008-12-06 16:47:21 christian.heimes set keywords:patch, patchmessages: +
2008-12-06 16:17:06 rpetrov set nosy: + rpetrovmessages: +
2008-12-06 09:23:46 christian.heimes set keywords:patch, patchfiles: + with_stdc89_2.patchmessages: +
2008-12-06 08:08:03 georg.brandl set keywords:patch, patchnosy: + georg.brandlmessages: +
2008-12-06 02:25:26 christian.heimes create