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: Help with bit-field semantics in C and C++


On Tue, 24 Aug 2004 22:12:55 +0200, Gabriel Dos Reis <gdr@integrable-solutions.net> said:

> The bits of the standard text the most relevant to Roger's question are

>         http://gcc.gnu.org/ml/gcc/2004-08/msg01167.html

> Those say that the sequence of statements

>      enum E x;

>      x = (E)n;

> store an unspecified value in the location designated by x.

An unspecified enumeration value, specifically, by 7.2/9.  Where
"enumeration value" is presumably defined by 7.2/6.

> It may be 0 or 1 or whatever fits, it does not matter.

It seems to me that the program has to behave as if it's 0 or 1: in
Roger's example, it's unspecified whether it should call foo() or
bar(), but it shouldn't core dump.

David Carlton
david.carlton@sun.com


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