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 22:45:42 +0200
- Subject: Re: Help with bit-field semantics in C and C++
- Organization: Integrable Solutions
- References: <195B2A50-F60D-11D8-AF5A-003065BDF310@apple.com>
Mike Stump <mrs@apple.com> writes:
| On Tuesday, August 24, 2004, at 12:37 PM, Gabriel Dos Reis 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
|
| Let me try it a different way... I am skeptical that taking
| additional advantage of rules that exist in C++ and not C is wise.
| Everything else flows from that.
Some programs for memory-constrained environment benefit from the
advantage that C++ enums can be smaller than C's. I see no value in
penalizing them, just because C chosed to optimize against
abstractions.
The C++ rules for enums are carefully crafted, not a result of
oversight. I see no benefits in actively betraying their letters and
spirits.
-- Gaby