underlying type for enums

Richard Henderson rth@redhat.com
Tue Dec 2 22:08:00 GMT 2003


On Tue, Dec 02, 2003 at 11:01:11AM -0800, Zack Weinberg wrote:
> Either way, it's an "integral type consisting of the specified number
> of bits" which is just what we want.

Interesting.  What does C90 say about integer conversion rank
wrt these types?  Cf section 6.3.1.1 in C99:

   -- The rank of a signed integer type shall be greater than the rank
      of any signed integer type with less precision.

which, for C99 means that "unsigned int f : sizeof(int)*CHAR_BIT - 1"
has rank < "int", and thus f+1 is type int and not unsigned int.
I do seem to recall there's some difference here between C90 and C99.

Perhaps that works the same, and is the bug Neil and Joseph have been
attempting to solve for N years...


r~



More information about the Gcc mailing list