Subject: Re: cast truncates bits from constant value (8000000000000000 becomes 0)

From: Geoff Levand <[email-masked]>
Date: Fri, 01 Dec 2006 13:17:08 -0800

Linus Torvalds wrote:
> Btw, try this stupid program, to see just how _strange_ gcc enums are.. A 
> sizeof of the enum is not the same as the size of the individual entries. 

Yes, interesting.  I think your comment regarding compatibility with other
compilers is the convincing one.

Another way is to change the encoding of the value such that it fits into
the range of an enum.  For this particular case, the values are actually
for a field in the high 3 bits, so I can just do the shift when the value
is used.

-Geoff