autoconf-patches
[Top][All Lists]
Advanced

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

Re: [SCM] GNU Autoconf source repository branch, master, updated. v2.67-


From: Paul Eggert
Subject: Re: [SCM] GNU Autoconf source repository branch, master, updated. v2.67-26-gd984765
Date: Tue, 24 Aug 2010 14:41:36 -0700
User-agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.1.11) Gecko/20100713 Thunderbird/3.0.6

On 08/24/2010 02:13 PM, Eric Blake wrote:
> Thanks.  Are you planning on syncing this back to gnulib as well?

No, I hadn't thought of that; thanks for reminding me.  Here's
what I installed:

>From bde8be8f5dd1105af5fc568680df3e84a35bfec5 Mon Sep 17 00:00:00 2001
From: Paul Eggert <address@hidden>
Date: Tue, 24 Aug 2010 14:36:27 -0700
Subject: [PATCH] stdbool: avoid spurious failure with modern xlc

* m4/stdbool.m4 (AC_HEADER_STDBOOL): Resync with autoconf.
---
 ChangeLog     |    5 +++++
 m4/stdbool.m4 |   24 +++++-------------------
 2 files changed, 10 insertions(+), 19 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index 660ec9b..fd84791 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2010-08-24  Paul Eggert  <address@hidden>
+
+       stdbool: avoid spurious failure with modern xlc
+       * m4/stdbool.m4 (AC_HEADER_STDBOOL): Resync with autoconf.
+
 2010-08-24  Bruno Haible  <address@hidden>
 
        getloadavg: simplify code
diff --git a/m4/stdbool.m4 b/m4/stdbool.m4
index fed31d9..4936746 100644
--- a/m4/stdbool.m4
+++ b/m4/stdbool.m4
@@ -35,7 +35,7 @@ AC_DEFUN([gl_STDBOOL_H], [AM_STDBOOL_H])
 
 # This version of the macro is needed in autoconf <= 2.67.  Autoconf has
 # it built in since 2.60, but we want the tweaks from the 2.68 version
-# to avoid rejecting clang due to relying on extensions.
+# to avoid rejecting xlc and clang due to relying on extensions.
 
 AC_DEFUN([AC_HEADER_STDBOOL],
   [AC_CACHE_CHECK([for stdbool.h that conforms to C99],
@@ -68,32 +68,17 @@ AC_DEFUN([AC_HEADER_STDBOOL],
           char b[false == 0 ? 1 : -1];
           char c[__bool_true_false_are_defined == 1 ? 1 : -1];
           char d[(bool) 0.5 == true ? 1 : -1];
-          bool e = &s;
+          /* See body of main program for 'e'.  */
           char f[(_Bool) 0.0 == false ? 1 : -1];
           char g[true];
           char h[sizeof (_Bool)];
           char i[sizeof s.t];
           enum { j = false, k = true, l = false * true, m = true * 256 };
+          /* The following fails for
+             HP aC++/ANSI C B3910B A.05.55 [Dec 04 2003]. */
           _Bool n[m];
           char o[sizeof n == m * sizeof n[0] ? 1 : -1];
           char p[-1 - (_Bool) 0 < 0 && -1 - (bool) 0 < 0 ? 1 : -1];
-          #ifdef __xlc__
-           /* Catch a bug in IBM AIX xlc compiler version 6.0.0.0
-              reported by James Lemley on 2005-10-05; see
-              
http://lists.gnu.org/archive/html/bug-coreutils/2005-10/msg00086.html
-              This test is not quite right, since xlc is allowed to
-              reject this program, as the initializer for xlcbug is
-              not one of the forms that C requires support for.
-              However, doing the test right would require a run-time
-              test, and that would make cross-compilation harder.
-              Let us hope that IBM fixes the xlc bug, and also adds
-              support for this kind of constant expression.  In the
-              meantime, this test will reject xlc, which is OK, since
-              our stdbool.h substitute should suffice.  We also test
-              in test-stdbool.c to ensure nothing else messes up.  */
-           char digs[] = "0123456789";
-           int xlcbug = 1 / (&(digs + 5)[-2 + (bool) 1] == &digs[4] ? 1 : 0);
-          #endif
           /* Catch a bug in an HP-UX C compiler.  See
              http://gcc.gnu.org/ml/gcc-patches/2003-12/msg02303.html
              
http://lists.gnu.org/archive/html/bug-coreutils/2005-11/msg00161.html
@@ -102,6 +87,7 @@ AC_DEFUN([AC_HEADER_STDBOOL],
           _Bool *pq = &q;
         ],
         [
+          bool e = &s;
           *pq |= q;
           *pq |= ! q;
           /* Refer to every declared value, to avoid compiler optimizations.  
*/
-- 
1.7.2




reply via email to

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