From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 4157 invoked by alias); 28 Nov 2008 19:26:10 -0000 Received: (qmail 2966 invoked by uid 48); 28 Nov 2008 19:24:45 -0000 Date: Fri, 28 Nov 2008 19:26:00 -0000 Message-ID: <20081128192445.2965.qmail@sourceware.org> X-Bugzilla-Reason: CC References: Subject: [Bug c++/38297] O2 causes invalid code In-Reply-To: Reply-To: gcc-bugzilla@gcc.gnu.org To: gcc-bugs@gcc.gnu.org From: "cdfrey at netdirect dot ca" Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-bugs-owner@gcc.gnu.org X-SW-Source: 2008-11/txt/msg02493.txt.bz2 ------- Comment #8 from cdfrey at netdirect dot ca 2008-11-28 19:24 ------- Why is the union access not portable, and listed as a GCC extension? According to the quotation of the standard at: http://mail-index.netbsd.org/tech-kern/2003/08/11/0001.html (this link is found in the GCC docs on this topic) The standard seems to list a union as a valid way to do type punning. I can understand if it's just a matter of other compilers being buggy, but is there any other reason that might make this non-portable? What am I missing? Thanks, - Chris -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=38297