[Top][All Lists]

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

Re: [Bug-gnulib] stdbool_.h bug breaks coreutils CVS sort on Alpha GCC 2

From: Paul Eggert
Subject: Re: [Bug-gnulib] stdbool_.h bug breaks coreutils CVS sort on Alpha GCC 2.95.4
Date: 03 Aug 2003 00:30:04 -0700
User-agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.3

Coreutils adopted that patch and I've heard no other comment so I
installed it into gnulib.

One other problem with stdbool_.h was noted by Nelson H. F. Beebe
to bug-coreutils yesterday:

Sun Solaris 2.8 (SPARC), Sun Solaris 2.9 (SPARC and Intel x86)
c89 -DHAVE_CONFIG_H -I. -I. -I..  -I.. -I. -I../lib -I../lib 
-I/usr/local/include  -xO5 -dalign -xlibmil -xcg92 -xsafe=mem -c `test -f 
'date.c' || echo './'`date.c
"../lib/stdbool.h", line 39: warning: _Bool is a keyword in ISO C99

This is not a fatal problem, but it causes lots of unnecessary warnings
for people using Sun's C compilers, and it'd be nice to avoid them.
How about the following patch to fix this?

2003-08-03  Paul Eggert  <address@hidden>

        * stdbool_.h (_Bool): Use a #define, not a typedef.

--- old/stdbool_.h      Sun Aug  3 00:09:12 2003
+++ new/stdbool_.h      Sun Aug  3 00:17:40 2003
@@ -32,11 +32,13 @@
 /* For the sake of symbolic names in gdb, define true and false as
    enum constants.  However, do not define _Bool as the enum type,
    since the enum type might be compatible with unsigned int, whereas
-   _Bool must promote to int.  */
+   _Bool must promote to int.  Also, make _Bool a macro rather than a
+   typedef, to suppress warnings by the Sun Forte Developer 7 C
+   compiler that _Bool is a keyword in ISO C99.  */
 #ifndef __cplusplus
 # if address@hidden@
 enum { false = 0, true = 1 };
-typedef signed char _Bool;
+#  define _Bool signed char
 # endif
 typedef bool _Bool;

reply via email to

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