This is the mail archive of the gcc-prs@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]

Re: c/1910: incorrect long long return value with -O2 optimization


The following reply was made to PR c/1910; it has been noted by GNATS.

From: Richard Henderson <rth@redhat.com>
To: djk@super.org
Cc: gcc-gnats@gcc.gnu.org
Subject: Re: c/1910: incorrect long long return value with -O2 optimization
Date: Fri, 9 Feb 2001 00:31:59 -0800

 On Thu, Feb 08, 2001 at 01:14:45PM -0000, djk@super.org wrote:
 >         struct cl val;
 >         val.one = a;
 >         val.two = 0;
 >         return *(long long *)&val;
 
 This code is incorrect.  You are running afoul of ISO C
 type aliasing rules.
 
 
 r~


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