From bfc4d94c7d92e8d463e830e28798ee7aadcfd47e Mon Sep 17 00:00:00 2001 From: Eric Blake Date: Mon, 23 Aug 2010 14:35:48 -0600 Subject: [PATCH] AC_HEADER_STDBOOL: avoid spurious clang failure * lib/autoconf/headers.m4 (AC_HEADER_STDBOOL): Drop gcc (and by extension clang) check in favor of a gnulib test. Force failure, rather than merely testing for a compiler extension. * THANKS: Update. Reported by Anders Kaseorg. Signed-off-by: Eric Blake --- ChangeLog | 9 +++++++++ THANKS | 1 + lib/autoconf/headers.m4 | 8 ++++---- 3 files changed, 14 insertions(+), 4 deletions(-) diff --git a/ChangeLog b/ChangeLog index 6d7bd7f55..9b271940d 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,12 @@ +2010-08-23 Eric Blake + + AC_HEADER_STDBOOL: avoid spurious clang failure + * lib/autoconf/headers.m4 (AC_HEADER_STDBOOL): Drop gcc (and by + extension clang) check in favor of a gnulib test. Force failure, + rather than merely testing for a compiler extension. + * THANKS: Update. + Reported by Anders Kaseorg. + 2010-08-22 Ralf Wildenhues doc: AIX sed dislikes indented comments. diff --git a/THANKS b/THANKS index 8f2691e1b..c79e21e2a 100644 --- a/THANKS +++ b/THANKS @@ -27,6 +27,7 @@ Alfred G. de Wijn dwijn@iluvatar.eu.org Alfred M. Szmidt ams@gnu.org Allan Caffee allan.caffee@gmail.com Allan Clark allanc@chickenandporn.com +Anders Kaseorg andersk@MIT.EDU Andreas Buening andreas.buening@nexgo.de Andreas Jaeger aj@suse.de Andreas Schott schott@rzg.mpg.de diff --git a/lib/autoconf/headers.m4 b/lib/autoconf/headers.m4 index c8d34c0c2..b97e09a90 100644 --- a/lib/autoconf/headers.m4 +++ b/lib/autoconf/headers.m4 @@ -639,7 +639,7 @@ AC_DEFUN([AC_HEADER_STDBOOL], _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]; -# if defined __xlc__ || defined __GNUC__ +# if defined __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 @@ -651,12 +651,12 @@ AC_DEFUN([AC_HEADER_STDBOOL], 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 - this with GCC, where it should work, to detect more + the gnulib stdbool.h substitute should suffice. Gnulib + also tests this case in test-stdbool.c, to detect more quickly whether someone messes up the test in the future. */ char digs[] = "0123456789"; - int xlcbug = 1 / (&(digs + 5)[-2 + (bool) 1] == &digs[4] ? 1 : -1); + 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 -- 2.47.3