[Top][All Lists]

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

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

From: Eric Blake
Subject: Re: bug: "gcc -std=gnu99" passes AC_PROG_CC_C11
Date: Tue, 25 Sep 2012 15:53:43 -0600
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:15.0) Gecko/20120911 Thunderbird/15.0.1

On 09/25/2012 03:22 PM, Adrian Bunk wrote:
> On Tue, Sep 25, 2012 at 01:58:29PM -0700, Paul Eggert wrote:
>> Sorry, I don't see a bug there.  "gcc -std=gnu99"
>> accepts ISO C11, in the sense that it passes all the
>> C11 tests that we have, if your version of GCC is
>> sufficiently new.  This is because the GCC supports
>> these C11 features even when running in C99 mode.
> The only compiler for which autoconf currently knows how to set it into 
> C11 mode passes the test in C99 mode.

No, the only compiler for which autoconf currently knows how to require
C11 compiler features happens to be gcc in 'gnu99' mode (C99 +
extensions, where those extensions happen to include C11 compiler features).

> That sounds a bit odd to me.

No odder than the fact that you can use -std=gnu89 to get C99 compiler
features on top of C89 requirements.

>> If there's some C11 feature that is missing,
>> a feature that it's reasonable to expect from C11
>> compilers, we could add that to the test, and this
>> will cause 'configure' to say "no" rather than "yes".
>> I did briefly try to think of such a feature but
>> came up dry.
> What about
> #if !defined(__STDC_VERSION__) || (__STDC_VERSION__ < 201112L)
> #error compiler is not in C11 mode
> #endif

That's not a compiler feature, but a feature of the system headers.
Compiler features (like _Bool, _Static_assert) can work even when
limiting yourself to an older standard.

Eric Blake   address@hidden    +1-919-301-3266
Libvirt virtualization library http://libvirt.org

Attachment: signature.asc
Description: OpenPGP digital signature

reply via email to

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