bug-gnulib
[Top][All Lists]
Advanced

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

Re: stdbool.h test v. Compaq C on Tru64


From: Paul Eggert
Subject: Re: stdbool.h test v. Compaq C on Tru64
Date: Mon, 22 Oct 2007 15:03:05 -0700
User-agent: Gnus/5.11 (Gnus v5.11) Emacs/22.1 (gnu/linux)

"Steven M. Schweda" <address@hidden> writes:

>    I suppose that if your goal is to reveal fairly exotic compiler
> quirks rather than to test for a usable stdbool.h,

Well, one person's "compiler quirks" are another person's "features"....

> cc: Error: ../lib/stdbool.h, line 104: Invalid enumerator. (badenum)
> enum { false = 0, true = 1 };

Thanks for the details.  I guess 'false' is a keyword or predefined
macro or something?

I installed the following patch to gnulib.  Basically it removes the
"line 104" mentioned above.  Can you please verify that it fixes your
problem?  Thanks.

2007-10-22  Paul Eggert  <address@hidden>

        Fix Tru64 problem with stdbool.h.
        * lib/stdbool.in.h (false, true):
        [! (defined __cplusplus || defined __BEOS__) && !defined __GNUC__]:
        Don't declare as an enum in this situation; it runs afoul of Tru64.
        Problem reported by Steven M. Schweda in
        <http://lists.gnu.org/archive/html/bug-autoconf/2007-10/msg00019.html>.

diff --git a/lib/stdbool.in.h b/lib/stdbool.in.h
index 150a010..2784a50 100644
--- a/lib/stdbool.in.h
+++ b/lib/stdbool.in.h
@@ -97,10 +97,11 @@ typedef bool _Bool;
           "warning: _Bool is a keyword in ISO C99".
         Use of an enum type, with IRIX cc, leads to a stupid
           "warning(1185): enumerated type mixed with another type".
-        The only benefit of the enum type, debuggability, is not important
-        with these compilers.  So use 'signed char' and no typedef.  */
+        Even the existence of an enum type, without a typedef,
+          "Invalid enumerator. (badenum)" with HP-UX cc on Tru64.
+        The only benefit of the enum, debuggability, is not important
+        with these compilers.  So use 'signed char' and no enum.  */
 #  define _Bool signed char
-enum { false = 0, true = 1 };
 # else
    /* With this compiler, trust the _Bool type if the compiler has it.  */
 #  if address@hidden@




reply via email to

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