Help with bit-field semantics in C and C++

Gabriel Dos Reis gdr@integrable-solutions.net
Tue Aug 24 21:46:00 GMT 2004


David Carlton <david.carlton@sun.com> writes:

| On Tue, 24 Aug 2004 14:11:17 -0700, Mark Mitchell <mark@codesourcery.com> said:
| 
| > The standard is just plain not clear here.  There's nothing that says
| > definitively what should happen, either with the conversion or with
| > the subsequent use, assuming that conversion to a value outside the
| > enum range is permitted.
| 
| But that last assumption isn't correct, is it?

Indeed, you're correct.

|  I don't see how that's
| consistent with 7.2p9: it talks about "the resulting enumeration
| value", which should surely mean that a value outside the enum range
| _isn't_ permitted.

Yes. An enumeration value is computed; exactly which is unspecified.
It does not need to be a meaningful one.

-- Gaby



More information about the Gcc mailing list