bug-autoconf
[Top][All Lists]
Advanced

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

Re: AC_HEADER_STDBOOL fails with clang


From: Anders Kaseorg
Subject: Re: AC_HEADER_STDBOOL fails with clang
Date: Sun, 22 Aug 2010 23:11:43 -0400 (EDT)
User-agent: Alpine 2.00 (DEB 1167 2008-08-23)

On Sun, 22 Aug 2010, Anders Kaseorg wrote:
> -      int xlcbug = 1 / (&(digs + 5)[-2 + (bool) 1] == &digs[4] ? 1 : -1);
> +      int xlcbug = 1 / (&((char *)0 + 5)[-2 + (bool) 1] == &((char *)0)[4] ? 
> 1 : -1);

Oh, actually, in order for this to actually test anything (other than the 
initializer extension), the -1 should always have been a 0:

diff --git a/lib/autoconf/headers.m4 b/lib/autoconf/headers.m4
index c8d34c0..8a7a549 100644
--- a/lib/autoconf/headers.m4
+++ b/lib/autoconf/headers.m4
@@ -655,8 +655,7 @@ AC_DEFUN([AC_HEADER_STDBOOL],
            this with GCC, where it should work, 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 / (&((char *)0 + 5)[-2 + (bool) 1] == &((char *)0)[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

Anders



reply via email to

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