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++
- From: Gabriel Dos Reis <gdr at integrable-solutions dot net>
- To: Mike Stump <mrs at apple dot com>
- Cc: Mark Mitchell <mark at codesourcery dot com>, Dave Korn <dk at artimi dot com>, "'Roger Sayle'" <roger at eyesopen dot com>, "'Joe Buck'" <Joe dot Buck at synopsys dot com>, gcc at gcc dot gnu dot org
- Date: 24 Aug 2004 21:37:06 +0200
- Subject: Re: Help with bit-field semantics in C and C++
- Organization: Integrable Solutions
- References: <4A6C00C5-F604-11D8-AF5A-003065BDF310@apple.com>
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