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++


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


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