bug-autoconf
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: bug: "gcc -std=gnu99" passes AC_PROG_CC_C11


From: Adrian Bunk
Subject: Re: bug: "gcc -std=gnu99" passes AC_PROG_CC_C11
Date: Tue, 2 Oct 2012 18:33:11 +0300
User-agent: Mutt/1.5.21 (2010-09-15)

On Tue, Oct 02, 2012 at 04:59:53PM +0200, Peter Rosin wrote:
> On 2012-10-02 16:02, Adrian Bunk wrote:
> > On Mon, Oct 01, 2012 at 03:40:31PM -0700, Paul Eggert wrote:
> >> On 10/01/2012 03:20 PM, Adrian Bunk wrote:
> >>> Not if they are set to default to C99 mode.
> >>
> >> Ah.  True.  That may be a problem for future
> >> versions of these two compilers, though it's
> >> not a problem for current versions.
> > 
> > The same would be true for adding a __STDC_VERSION__ check to the 
> > current C11 test, since all compilers that currently pass the C11
> > test (only gcc 4.7) define it to the correct value...
> 
> If Autoconf checks __STDC_VERSION__, I fear that future compilers
> will simply lie if they have some of the desired features, just to
> get past the check.

In practice usage of __STDC_VERSION__ in compilers is to show the mode 
they are in, not a claim that they support the standard completely.

As an example, gcc defines the C99 resp. C11 values for __STDC_VERSION__  
when it is in C99 resp. C11 mode, even though it supports neither of 
these standards completely.

And that makes sense, since when writing C11 code you e.g. want glibc
to offer C11 functions, even though other areas of C11 are not yet 
implemented in gcc.

> Checking it will put pressure on the compiler
> vendors to set it, even when they aren't compliant (and know it).
> I predict that checking it will dilute the usefulness of
> __STDC_VERSION__.

Using __STDC_VERSION__ as a check for complete C11 support is anyway not 
working (see my gcc example above).

> Cheers,
> Peter

cu
Adrian

-- 

       "Is there not promise of rain?" Ling Tan asked suddenly out
        of the darkness. There had been need of rain for many days.
       "Only a promise," Lao Er said.
                                       Pearl S. Buck - Dragon Seed




reply via email to

[Prev in Thread] Current Thread [Next in Thread]