changeset 5075:da468be96043

Detect _Bool bug in HP aC++/ANSI C B3910B A.05.55 [Dec 04 2003].
author Paul Eggert <eggert@cs.ucla.edu>
date Tue, 01 Jun 2004 05:41:30 +0000
parents 5f558ceff8fb
children 555edbcc1a54
files m4/ChangeLog m4/stdbool.m4
diffstat 2 files changed, 17 insertions(+), 5 deletions(-) [+]
line wrap: on
line diff
--- a/m4/ChangeLog
+++ b/m4/ChangeLog
@@ -1,3 +1,9 @@
+2004-05-31  Paul Eggert  <eggert@cs.ucla.edu>
+
+	* stdbool.m4 (AC_HEADER_STDBOOL): Detect _Bool bug in HP aC++/ANSI
+	C B3910B A.05.55 [Dec 04 2003].  Problem reported by Jim Meyering.
+	Also, fix a typo in a diagnostic.
+
 2004-05-30  Paul Eggert  <eggert@cs.ucla.edu>
 
 	* xalloc.m4 (gl_PREREQ_XMALLOC): Do not require AC_FUNC_MALLOC
@@ -26,7 +32,7 @@
 	Check for gettimeofday.
 	* settime.m4 (gl_SETTIME): Require gl_TIMESPEC.
 	Check for settimeofday, stime.
-	
+
 2004-04-20  Paul Eggert  <eggert@twinsun.com>
 
 	* host-os.m4: Add a copyright notice.
--- a/m4/stdbool.m4
+++ b/m4/stdbool.m4
@@ -1,6 +1,6 @@
 # Check for stdbool.h that conforms to C99.
 
-# Copyright (C) 2002-2003 Free Software Foundation, Inc.
+# Copyright (C) 2002-2004 Free Software Foundation, Inc.
 
 # This program is free software; you can redistribute it and/or modify
 # it under the terms of the GNU General Public License as published by
@@ -40,7 +40,7 @@
   AC_SUBST([HAVE__BOOL])
 ])
 
-# This macro is only needed in autoconf <= 2.54.  Newer versions of autoconf
+# This macro is only needed in autoconf <= 2.59.  Newer versions of autoconf
 # have this macro built-in.
 
 AC_DEFUN([AC_HEADER_STDBOOL],
@@ -59,7 +59,7 @@
 	   "error: false is not 0"
 	  #endif
 	  #ifndef true
-	   "error: false is not defined"
+	   "error: true is not defined"
 	  #endif
 	  #if true != 1
 	   "error: true is not 1"
@@ -79,8 +79,14 @@
 	  char g[true];
 	  char h[sizeof (_Bool)];
 	  char i[sizeof s.t];
+	  enum { j = false, k = true, l = false * true, m = true * 256 };
+	  _Bool n[m];
+	  char o[sizeof n == m * sizeof n[0] ? 1 : -1];
 	],
-	[ return !a + !b + !c + !d + !e + !f + !g + !h + !i; ],
+	[
+	  return (!a + !b + !c + !d + !e + !f + !g + !h + !i + !j + !k + !l
+		  + !m + !n + !o);
+	],
 	[ac_cv_header_stdbool_h=yes],
 	[ac_cv_header_stdbool_h=no])])
    AC_CHECK_TYPES([_Bool])