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: Mike Stump <mrs at apple dot com>
- To: Joe Buck <Joe dot Buck at synopsys dot com>
- Cc: Mark Mitchell <mark at codesourcery dot com>, Gabriel Dos Reis <gdr at integrable-solutions dot net>, David Carlton <david dot carlton at sun dot com>, Dave Korn <dk at artimi dot com>, "'Roger Sayle'" <roger at eyesopen dot com>, gcc at gcc dot gnu dot org
- Date: Tue, 24 Aug 2004 16:00:39 -0700
- Subject: Re: Help with bit-field semantics in C and C++
On Tuesday, August 24, 2004, at 03:31 PM, Joe Buck wrote:
On Tue, Aug 24, 2004 at 02:58:33PM -0700, Mark Mitchell wrote:
The people who write testsuites for a living think a lot about corner
cases and try to write tests that cause compilers to get the corner
cases wrong. They go through the standard line-by-line, thinking of
pathological things. None of them have ever written the test that
David
is suggesting.
But the suggested test is clearly a non-conforming program, one whose
behavior is unspecified.
Man, talk about mixing metaphors...
First, non-conforming doesn't exist in C++, that is from the C standard.
Second, the you are thinking about a strictly conforming program:
[#5] A strictly conforming program shall use only those
features of the language and library specified in this
International Standard.2) It shall not produce output
dependent on any unspecified, undefined, or implementation-
defined behavior, and shall not exceed any minimum
implementation limit.
a conforming program is different:
[#7] A conforming program is one that is acceptable to a
conforming implementation.4)
Because the program is accepted, it is a conforming program, because it
is conforming, it cannot be non-conforming.