This is the mail archive of the
mailing list for the GCC project.
Re: a warning to implement
- From: Gabriel Dos Reis <gdr at codesourcery dot com>
- To: dewar at gnat dot com (Robert Dewar)
- Cc: gdr at codesourcery dot com, nathan at cs dot bris dot ac dot uk, gcc at gcc dot gnu dot org, rsandifo at redhat dot com
- Date: 06 Feb 2002 18:18:30 +0100
- Subject: Re: a warning to implement
- Organization: CodeSourcery, LLC
- References: <20020206165056.9FC29F28CF@nile.gnat.com>
email@example.com (Robert Dewar) writes:
| >>Except when T = char or unsigned char.
| Please explain why you think this is an exception?
Clearly that is spelt out in the C standard -- I think the same
applies in C++ (I'll quote appropriate text later). It has always
been an established practice in C and C++ to examine raw memory with
objects of character type.
Certain object representations need not represent a value of the
object type. If the stored value of the object has such a
representation and is read by an lvalue expression that does not
have character type, the behavior is undefined. If such a
representation is produced by a side effect thaty modifies all or
any part of the object by an lvalue expression that does not have
character type, the behavior is undefined. Such a representation is
called a trap represetation.