Strange enum type conversion

Ineiev ineiev@gmail.com
Thu Dec 3 12:10:00 GMT 2009


On 12/3/09, Hajo Münzer <hans-joachim.muenzer@gmx.de> wrote:
>In the following
> enum's (see code below) the en1 and en2 are converted to a 64 bit type
> ("long long int" in i686 GNU/Linux or "long int" in x86_64 GNU/Linux).

Perhaps the confusing thing is that en1 is a constant compatible with int
(-2^31), but en2 is a constant compatible with long lont int (in the
32 bit case).

Actually, the standard requires that all values be representable with plain int,
so the code is probably invalid.



More information about the Gcc-help mailing list