[PATCH] Workaround more _Bool problems on HP-UX

Richard Henderson rth@redhat.com
Sat Jan 24 09:34:00 GMT 2004


On Fri, Jan 23, 2004 at 09:23:42PM -0500, Kaveh R. Ghazi wrote:
> Hmm, would you please refresh my memory as to why it's so bad?  (Or
> point me at the URL thread where you already discussed it.)

Don't recall where; I'm sure it was in some random thread.

Why?  Because (1) it's non-standard and (2) provides no type data beyond
unsigned int.  Point 2 separates it from gcc's bit field enumeration
extension.  In other words, it provides scant benefit at all.  Zero, in
fact, given how alignment works with memory allocation; you may reduce
the size of the struct only shift the bytes to the overhead column.
I'll stress *may* because I doubt it, given that it requires that there 
e *no* other fields that require int alignment.

Bool, on the other hand, provides interesting type information.

> Something like this?  (Suitably polished and propagated.)
> If so, what GCC_VERSION should it be activated on?  (3.0?)

Something like that.  I don't know what version.  In theory, we could
use _Bool for any proper C99 compiler, though the HP experience makes
me wonder how we can identify such a beast.


r~



More information about the Gcc-patches mailing list