This is the mail archive of the gcc-patches@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: RFA and RFC: tweak -fstrict-aliasing docs, provide pointer-cast example


On Tue, 24 Jun 2008, Hans-Peter Nilsson wrote:

> There's background in
> <http://gcc.gnu.org/bugzilla/show_bug.cgi?id=36593>.  Neither
> Richi nor me could find the union-assignment "gcc extension" at
> a glance, probably because it's not an *extension* but an
> implementation-defined behavior, and actually duly documented as
> such.  However, to cross-reference that section together with

And also explicitly described in a footnote added in C99 TC3:

    15. Page 073, 6.5.2.3
    Attach a new footnote to the words "named member" in paragraph 3:

    *) If the member used to access the contents of a union object is not 
    the same as the member last used to store a value in the object, the 
    appropriate part of the object representation of the value is 
    reinterpreted as an object representation in the new type as described 
    in 6.2.6 (a process sometimes called "type punning"). This might be a 
    trap representation.

The doc patch is OK.  (I think "is not allowed" is misleading when 
describing code that is compile-time valid but had undefined behavior if 
executed, but feel free to put "has undefined behavior" in place of "might 
not work" if you wish.)

-- 
Joseph S. Myers
joseph@codesourcery.com


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