bug-gnulib
[Top][All Lists]
Advanced

[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: 07 Aug 2003 16:42:30 -0700
User-agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.3

Bruno Haible <address@hidden> writes:


> + typedef enum { false = 0, true = 1 } _Bool;

This still has problems in emulating C99, compared to what's currently
installed.  In C99, sizeof(_Bool) must be 1, but this is not true of
the enum type.  This is not merely a standards-conformance issue, as
at least one <stdbool.h> client now declares arrays of bool, and such
arrays will grow in size, typically by a factor of 4, if bool is an
enum type.

I suppose we could test whether the enum is signed, and also whether
it has size 1; but I don't offhand know of any platforms where it has
both properties, so I suspect such a test would be overkill.  Let's
just leave _Bool as a signed char; that's simpler and less likely to
go wrong.


> + #   if defined __sun && !defined __GNUC__

I think there are other C compilers for Sun; also, the warning has
been suppressed in the current version (5.5) of the Sun C compiler, if
you don't compile in pedantic mode.  So a more accurate expression
would be:

# if defined __SUNPRO_C && (__SUNPRO_C < 0x550 || __STDC__ == 1)

However, I'd still prefer not making a special case in the source code
for Sun, due to the maintenance hassle.




reply via email to

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