+2010-08-24 Paul Eggert <eggert@cs.ucla.edu>
+
+ AC_HEADER_STDBOOL: avoid spurious failure with modern xlc
+ * lib/autoconf/headers.m4 (AC_HEADER_STDBOOL): Move the "bool e =
+ &s;" test into the main program, as C99 might plausibly be
+ interpreted as not requiring support for this construction in
+ static initializers. Remove the "#if defined __xlc__" stuff, as
+ the bug is not present in recent xlc implementations, and they
+ reject the test for other (valid) reasons. People using ancient
+ xlc versions, if any, are suggested to update to fixed versions.
+ Reported by Ralf Wildenhues in the thread starting at:
+ http://lists.gnu.org/archive/html/bug-autoconf/2010-08/msg00103.html
+
2010-08-24 Eric Blake <eblake@redhat.com>
AC_FUNC_GETLOADAVG: don't define SVR4 on cygwin
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)];
_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__
- /* 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 runtime
- 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
- 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 : 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
_Bool *pq = &q;
]],
[[
+ bool e = &s;
*pq |= q;
*pq |= ! q;
/* Refer to every declared value, to avoid compiler optimizations. */