This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: Help with bit-field semantics in C and C++
Mike Stump <mrs@apple.com> writes:
| On Aug 26, 2004, at 6:26 PM, Gabriel Dos Reis wrote:
| > After exchange on the core reflector, John Spicer came to the
| > agreement that it is the enumeration value that is unspecified.
|
| So
|
| e = (E)7;
|
| printf ("%d\n", (int)e));
|
| should print 3, and not 7 as is does now, and this should work by
| converting integer types into enumeration types, and not by masking
| upon converting enumeration types to ints? Did I get that right?
Yes, the masking happens when converting from integer to enumeration,
not from enumeration to integer.
| We can do that. Wanna ask Tom to put this in his testsuite, so that
| we can get all the other C++ compilers to switch?
OK.
Thanks,
-- Gaby