[PATCH app-xdm 09/11] config: remove AC_PROG_CC as it overrides AC_PROG_C_C99

Gaetan Nadon memsize at videotron.ca
Sun Aug 29 09:51:58 PDT 2010


On Sun, 2010-08-29 at 16:35 +0200, Mark Kettenis wrote:

> I'm confused here.  Why does xdm (or anything in Xorg for that matter)
> use AC_PROG_C_C99?  Things are still supposed to compile with a C89
> compiler with a minimal set of C99 extensions.  And surely if C99 is
> requested, we want standard C99 and not the GNU dialect implied by
> -std=gnu99?
> 


It began with the addition of the XORG_STRICT_OPTION
http://cgit.freedesktop.org/xorg/util/macros/commit/?id=3b7dd69d0bf6bc19f0e4403bb6611de87497aac3


        Add XORG_STRICT_OPTION macro for strict compilation option
        Strict compilation option can be used to get rid of warnings that often are showing
        real hidden bug in code. That just waits to cause problems.
        
        CWARNFLAGS has to be added to AM_C(PP)FLAGS to use strict compilation mode
        in Makefile.am. Automatic addition to compiler flags would cause some configure
        checks fail. 
        
        Signed-off-by: Peter Hutterer <peter.hutterer at who-t.net>

This macro is included in XORG_DEFAULTS, but it is canceled out by
AC_PROG_CC when it is present in a module.
A survey showed about half the modules were 89 and the other were 99.

I have no personal opinion on that matter, I am following what appears
to be the main path. I don't know what the situation was prior to the
introduction of XORG_STRICT_OPTION. I just did a grep and no module has
the AC_PROG_C_C99 macro. That means about half the moduls did not
specify anything and got AC_PROG_CC by default through libtool or
something like that.

According to the comment, it attempts to select the C99 mode of the
installed compiler.


        # _AC_PROG_CC_C99 ([ACTION-IF-AVAILABLE], [ACTION-IF-UNAVAILABLE])
        # ----------------------------------------------------------------
        # If the C compiler is not in ISO C99 mode by default, try to add an
        # option to output variable CC to make it so.  This macro tries
        # various options that select ISO C99 on some system or another.  It
        # considers the compiler to be in ISO C99 mode if it handles _Bool,
        # // comments, flexible array members, inline, long long int, mixed
        # code and declarations, named initialization of structs, restrict,
        # va_copy, varargs macros, variable declarations in for loops and
        # variable length arrays.
        
        GCC		-std=gnu99 (unused restrictive modes: -std=c99 -std=iso9899:1999)
        AIX		-qlanglvl=extc99 (unused restrictive mode: -qlanglvl=stdc99)
        HP cc		-AC99
        Intel ICC	-std=c99, -c99 (deprecated)
        IRIX		-c99
        Solaris		-xc99=all (Forte Developer 7 C mishandles -xc99 on Solaris 9,
        		as it incorrectly assumes C99 semantics for library functions)
        Tru64		-c99


Gaetan
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.x.org/archives/xorg-devel/attachments/20100829/ced89726/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 197 bytes
Desc: This is a digitally signed message part
URL: <http://lists.x.org/archives/xorg-devel/attachments/20100829/ced89726/attachment.pgp>


More information about the xorg-devel mailing list