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

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

 



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

-
To unsubscribe from this list: send the line "unsubscribe linux-sparse" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Newbies FAQ]     [LKML]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Trinity Fuzzer Tool]

  Powered by Linux