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: a warning to implement


dewar@gnat.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.

6.2.6.1/5

  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.

-- Gaby


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