http://drj11.wordpress.com/2008/10/02/python-and-bragging-about-c89/ mentions that Objects/frameobject.c contains a C99-style comment, which means that Python 2.6 won't build on AIX. shouldn't we use a suitable gcc option for the buildbots to prevent that from happening? </F>
Fredrik Lundh wrote:
http://drj11.wordpress.com/2008/10/02/python-and-bragging-about-c89/
mentions that Objects/frameobject.c contains a C99-style comment, which means that Python 2.6 won't build on AIX.
shouldn't we use a suitable gcc option for the buildbots to prevent that from happening?
Ouch! This shouldn't have happend. I'm going to discuss the matter on #python-dev. Perhaps --with-pydebug could add more restrict error checking to the Makefile like -std=c89 -pedantic -Werror Christian
Christian Heimes <lists <at> cheimes.de> writes:
Ouch! This shouldn't have happend. I'm going to discuss the matter on #python-dev. Perhaps --with-pydebug could add more restrict error checking to the Makefile like -std=c89 -pedantic -Werror
As discussed on python-dev, I think it should also be added in release mode. Some developers probably never compile in debug mode (*), and compiling in release mode is useful when you want to do performance tuning. (*) not thinking of anyone in particular ! Regards Antoine.
Fredrik Lundh wrote:
http://drj11.wordpress.com/2008/10/02/python-and-bragging-about-c89/
I've found several more occasions of // comments and one usage of inline. We *really* should have some way to compile Python with C89 checks Python doesn't compile with the -pedantic option but it compiles with -std=c89 -Werror after I've applied some patches. I've added a new make command to add extra checks. Maybe the build bots could use "make c89" instead of "make" to build Python? c89: $(MAKE) CFLAGS="$(CFLAGS) -std=c89 -Werror" Christian
Martin v. Löwis wrote:
shouldn't we use a suitable gcc option for the buildbots to prevent that from happening?
Which one specifically?
I suggest we add "-std=c89" to CFLAGS. We could also add a new target called buildbot to the Makefile that appends "-std=c89 -Werror" to CFLAGS. I don't think it's wise to add "-Werror" to the standard build target. However a new build target with extra checks should help to detect errors much sooner. Christian
shouldn't we use a suitable gcc option for the buildbots to prevent that from happening?
Which one specifically?
I suggest we add "-std=c89" to CFLAGS.
That needs thorough testing, in particular across many old Linux distributions. It might be that some sets of Linux header files rely on GNU C extensions, without using the __extension__ keyword.
We could also add a new target called buildbot to the Makefile that appends "-std=c89 -Werror" to CFLAGS. I don't think it's wise to add "-Werror" to the standard build target. However a new build target with extra checks should help to detect errors much sooner.
That would need to go along with a policy that Python must never cause GCC to emit any warnings. Regards, Martin
>>>> shouldn't we use a suitable gcc option for the buildbots to prevent >>>> that from happening? >>> >>> Which one specifically? >> >> I suggest we add "-std=c89" to CFLAGS. Martin> That needs thorough testing, in particular across many old Linux Martin> distributions. It might be that some sets of Linux header files Martin> rely on GNU C extensions, without using the __extension__ Martin> keyword. Surely we don't need to be that careful with the buildbots do we? If anything, I think it would be a good idea to be more strict for them than the default. Skip
participants (5)
-
"Martin v. Löwis"
-
Antoine Pitrou
-
Christian Heimes
-
Fredrik Lundh
-
skip@pobox.com