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

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


Mike Stump <mrs@apple.com> writes:

| On Tuesday, August 24, 2004, at 11:33  AM, Mark Mitchell wrote:
| > The enum case is more like NaNs
| 
| ?  Can you please back this by citing the standard?

7.2/6
  For an enumeration where emin is the smallest enumerator and emax is
  the largest, the values of the enumeration are the values of the
  underlying type in the range bmin to bmax, where bmin and bmax are,
  respectively, the smallest and largest values of the smallest
  bit-field that can store emin and emax.81) It is possible to define
  an enumeration that has values not defined by any of its
  enumerators. 

7.2/9
  An expression of arithmetic or enumeration type can be converted to 
  an enumeration type explicitly. The value is unchanged if it is in
  the range of enumeration values of the enumeration type; otherwise
  the resulting enumeration value is unspecified.

-- Gaby



More information about the Gcc mailing list