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: Paul Eggert
Subject: Re: bug: "gcc -std=gnu99" passes AC_PROG_CC_C11
Date: Wed, 26 Sep 2012 08:03:01 -0700
User-agent: Mozilla/5.0 (X11; Linux i686; rv:15.0) Gecko/20120827 Thunderbird/15.0

On 09/26/2012 06:24 AM, Adrian Bunk wrote:

> You assume gnu99 will always include all features of gnu11?

Yes.  I don't see why it wouldn't.  C11 is not incompatible
with C99, the way that C99 was incompatible with C89.
(Again, except for 'gets'.)

As I understand it, the scenario you're worried about is that if a
package really needs C11 features that -std=gnu99 would disable in
future hypothetical versions of GCC, and if the package's builder
then runs 'configure CC="gcc -std=gnu99"', then AC_PROG_CC won't
replace that '-std=gnu99' with '-std=gnu11'.  But this scenario
is so implausible that surely we need not worry about it.  Or
possibly I'm misunderstanding you....

> - currently gcc >= 4.7 is the only compiler supported for that in 
>   autoconf

True, but I just now pushed this for IBM XL C.  And it will come
in the other compilers.

>From 97e027a8f736c9754212607cb01f87a5997699b0 Mon Sep 17 00:00:00 2001
From: Paul Eggert <address@hidden>
Date: Wed, 26 Sep 2012 07:49:59 -0700
Subject: [PATCH] AC_PROG_CC: try -qlanglvl=extc1x, for IBM XL C V12.1

* lib/autoconf/c.m4 (_AC_PROG_CC_C11): Add -qlanglvl=extc1x, for
IBM XL C V12.1.  It shouldn't pass the C11 test yet, since it's not
documented to support _Alignas, _Alignof, UTF-8 string literals,
and duplicate typedefs, but presumably it will eventually.
---
 lib/autoconf/c.m4 | 11 ++++++-----
 1 file changed, 6 insertions(+), 5 deletions(-)

diff --git a/lib/autoconf/c.m4 b/lib/autoconf/c.m4
index 808c104..0309416 100644
--- a/lib/autoconf/c.m4
+++ b/lib/autoconf/c.m4
@@ -1347,7 +1347,7 @@ AC_DEFUN([_AC_PROG_CC_C99],
 [_AC_C_C99_TEST_BODY],
 dnl Try
 dnl GCC                -std=gnu99 (unused restrictive modes: -std=c99 
-std=iso9899:1999)
-dnl AIX                -qlanglvl=extc99 (unused restrictive mode: 
-qlanglvl=stdc99)
+dnl IBM XL C   -qlanglvl=extc99 (unused restrictive mode: -qlanglvl=stdc99)
 dnl HP cc      -AC99
 dnl Intel ICC  -std=c99, -c99 (deprecated)
 dnl IRIX       -c99
@@ -1432,8 +1432,9 @@ struct anonymous
 ]],
 dnl Try
 dnl GCC                -std=gnu11 (unused restrictive mode: -std=c11)
+dnl IBM XL C   -qlanglvl=extc1x (no extc11 or (unused) stdc11 in V12.1)
 dnl with extended modes being tried first.
-[[-std=gnu11]], [$1], [$2])[]dnl
+[[-std=gnu11 -qlanglvl=extc1x]], [$1], [$2])[]dnl
 ])# _AC_PROG_CC_C11
 
 
@@ -1740,7 +1741,7 @@ AC_DEFUN([AC_C_CONST],
   /* NEC SVR4.0.2 mips cc rejects this.  */
   struct point {int x, y;};
   static struct point const zero = {0,0};
-  /* AIX XL C 1.02.0.0 rejects this.
+  /* IBM XL C 1.02.0.0 rejects this.
      It does not let you subtract one const X* pointer from another in
      an arm of an if-expression whose if-part is not a constant
      expression */
@@ -1768,7 +1769,7 @@ AC_DEFUN([AC_C_CONST],
     iptr p = 0;
     ++p;
   }
-  { /* AIX XL C 1.02.0.0 rejects this sort of thing, saying
+  { /* IBM XL C 1.02.0.0 rejects this sort of thing, saying
        "k.c", line 2.27: 1506-025 (S) Operand must be a modifiable lvalue. */
     struct s { int j; const int *ap[3]; } bx;
     struct s *b = &bx; b->j = 5;
@@ -2064,7 +2065,7 @@ AC_DEFUN([AC_OPENMP],
          dnl   Intel C              -openmp
          dnl   SGI C, PGI C         -mp
          dnl   Tru64 Compaq C       -omp
-         dnl   IBM C (AIX, Linux)   -qsmp=omp
+         dnl   IBM XL C (AIX, Linux) -qsmp=omp
           dnl   Cray CCE             -homp
           dnl   NEC SX               -Popenmp
           dnl   Lahey Fortran (Linux)  --openmp
-- 
1.7.11.4






reply via email to

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