Fredrik Lundh | 2 Oct 19:46

c99 comments in the 2.6 code base?

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>

_______________________________________________
Python-Dev mailing list
Python-Dev <at> python.org
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: http://mail.python.org/mailman/options/python-dev/python-python-dev%40m.gmane.org

Christian Heimes | 2 Oct 20:23
Favicon

Re: c99 comments in the 2.6 code base?

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

_______________________________________________
Python-Dev mailing list
Python-Dev <at> python.org
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: http://mail.python.org/mailman/options/python-dev/python-python-dev%40m.gmane.org

Antoine Pitrou | 2 Oct 20:37

Re: c99 comments in the 2.6 code base?

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.

_______________________________________________
Python-Dev mailing list
Python-Dev <at> python.org
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: http://mail.python.org/mailman/options/python-dev/python-python-dev%40m.gmane.org

Christian Heimes | 2 Oct 21:47
Favicon

Re: c99 comments in the 2.6 code base?

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

_______________________________________________
Python-Dev mailing list
Python-Dev <at> python.org
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: http://mail.python.org/mailman/options/python-dev/python-python-dev%40m.gmane.org

Re: c99 comments in the 2.6 code base?

> shouldn't we use a suitable gcc option for the buildbots to prevent that
> from happening?

Which one specifically?

Regards,
Martin
_______________________________________________
Python-Dev mailing list
Python-Dev <at> python.org
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: http://mail.python.org/mailman/options/python-dev/python-python-dev%40m.gmane.org

Christian Heimes | 3 Oct 01:30
Favicon

Re: c99 comments in the 2.6 code base?

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
_______________________________________________
Python-Dev mailing list
Python-Dev <at> python.org
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: http://mail.python.org/mailman/options/python-dev/python-python-dev%40m.gmane.org

Re: c99 comments in the 2.6 code base?

>>> 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
_______________________________________________
Python-Dev mailing list
Python-Dev <at> python.org
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: http://mail.python.org/mailman/options/python-dev/python-python-dev%40m.gmane.org

skip | 3 Oct 02:40
Favicon

Re: c99 comments in the 2.6 code base?


    >>>> 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
_______________________________________________
Python-Dev mailing list
Python-Dev <at> python.org
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: http://mail.python.org/mailman/options/python-dev/python-python-dev%40m.gmane.org


Gmane