On Tue, Sep 25, 2012 at 04:04:27PM -0700, Paul Eggert wrote: > On 09/25/2012 02:22 PM, Adrian Bunk wrote: > > #if !defined(__STDC_VERSION__) || (__STDC_VERSION__ < 201112L) > > If that's what the user wants, they have that already; > they don't need Autoconf for it.
We are talking about the "put the compiler into the highest mode possible" logic in AC_PROG_CC. If a future gcc version - defaults to gnu99 mode (defaulting to a higher C mode is documented to happen in gcc in the future) and - supports C11 features in gnu11 mode it doesn't support in gnu99 mode (likely) then this bug will cause problems. Testing for features not documented to be tested for ac_cv_prog_cc_c11 is a duty of the user, but the user shouldn't have to fiddle with the compiler mode after AC_PROG_CC. > Surely it's more > useful if Autoconf tests for actual features rather > than testing __STDC_VERSION__. I am not suggesting to remove the existing parts of the C11 check. > Historically, defining > __STDC_VERSION__ has often meant "I support the > standard and nothing more -- I'm being pedantic" > which is not typically what's really wanted. Historically, compilers were not supporting C11. Currently gcc is the only compiler where autoconf knows how to put it into C11 mode, and __STDC_VERSION__ is defined in gnu11 mode. If __STDC_VERSION__ becomes a problem when C11 options for other compilers get added, then the __STDC_VERSION__ test could be put inside an "#ifdef __GNUC__". 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