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]

Undefined behavior due to 6.5.16.1p3


I was wondering whether GCC uses 6.5.16.1p3 of the C11 standard as a license to perform certain optimizations. If so, could anyone provide me an example program.

In particular, I am interested about the "then the overlap shall be exact" part of 6.5.16.1p3:

  If the value being stored in an object is read from another
  object that overlaps in any way the storage of the first
  object, then the overlap shall be exact and the two objects
  shall have qualified or unqualified versions of a compatible
  type; otherwise, the behavior is undefined.


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