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

Mark Kettenis mark.kettenis at xs4all.nl
Mon Aug 30 05:00:57 PDT 2010


> From: Gaetan Nadon <memsize at videotron.ca>
> Date: Sun, 29 Aug 2010 12:51:58 -0400
> 
> 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.

It seems to prefer a permissive mode over the more restrictive modes
that would be more useful for the XORG_STRUCT_OPTION though.  But
since some C99 extensions are allowed in Xorg, I suppose we have no
choice (other than implementing our own autoconf macro for this).

Thanks you for taking the time to explain things!

Mark



More information about the xorg-devel mailing list