https://gcc.gnu.org/bugzilla/show_bug.cgi?id=107405

--- Comment #11 from Jiri Slaby <jirislaby at gmail dot com> ---
(In reply to Jiri Slaby from comment #10)
> Ah, that's correct. So the question then is: is it a feature we can rely on
> (even if undocumented -- can the behavior can be documented in gcc?), or we
> should drop enum uses for values > MAX_INT?

I think section 4.9 of gcc manual actually defines this:

The integer type compatible with each enumerated type (C90 6.5.2.2, C99 and C11
6.7.2.2).

  Normally, the type is unsigned int if there are no negative values in the
enumeration, otherwise int. 

So as long as all are unsigned, all is fine.

So it remains to define what happens when there is an u/long (the case above).

Reply via email to