This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Warning about int<-->enum conversions?


Giovanni Bajo wrote:

No, because this is a kind of integer promotion which is allowed by the
standard ([conv.prom]/2), so there is nothing wrong about it. Converting the
other way (int -> enum) is instead forbidden and should be rejected by GCC.

But warnings are all *about* things that are allowed by the standard but are still suspicious. To me, it is a dubious design decision in the language to allow this promotion, and I definitely think that a warning would be useful.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]