+2010-12-19 Bruno Haible <bruno@clisp.org>
+
+ stdbool: Relax test.
+ * tests/test-stdbool.c (e): Don't require that casts from a variable's
+ address to 'bool' work in static initializer, for compilers other than
+ GCC.
+
2010-12-19 Bruno Haible <bruno@clisp.org>
ftello: Add missing declaration on OSF/1 5.1.
char c[__bool_true_false_are_defined == 1 ? 1 : -1];
#if HAVE_STDBOOL_H || defined __GNUC__ /* See above. */
char d[(bool) 0.5 == true ? 1 : -1];
-# ifdef ADDRESS_CHECK_OKAY
+# ifdef ADDRESS_CHECK_OKAY /* Avoid gcc warning. */
+/* C99 may plausibly be interpreted as not requiring support for a cast from
+ a variable's address to bool in a static initializer. So treat it like a
+ GCC extension. */
+# ifdef __GNUC__
bool e = &s;
+# endif
# endif
char f[(_Bool) 0.0 == false ? 1 : -1];
#endif
int
main ()
{
+#if HAVE_STDBOOL_H || defined __GNUC__ /* See above. */
+# ifdef ADDRESS_CHECK_OKAY /* Avoid gcc warning. */
+ /* A cast from a variable's address to bool is valid in expressions. */
+ bool e1 = &s;
+# endif
+#endif
+
/* 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