From mboxrd@z Thu Jan 1 00:00:00 1970 From: Wilco van Hoogstraeten To: nobody@gcc.gnu.org Cc: gcc-prs@gcc.gnu.org Subject: Re: c/4302: wrong code generated Date: Wed, 12 Sep 2001 09:06:00 -0000 Message-id: <20010912160601.20533.qmail@sourceware.cygnus.com> X-SW-Source: 2001-09/msg00248.html List-Id: The following reply was made to PR c/4302; it has been noted by GNATS. From: Wilco van Hoogstraeten To: Andreas Jaeger Cc: wilco@trimedia.com, gcc-gnats@gcc.gnu.org Subject: Re: c/4302: wrong code generated Date: Wed, 12 Sep 2001 08:59:01 -0700 Andreas Jaeger wrote: > wilco@trimedia.com writes: > [...] > > >Description: > > Wrong code generated: > > > > marilyn % cat tmp.i > > extern int printf( const char* args, ... ); > > > > int main( ) > > { > > long long X, Y; > > > > Y = -3000000000LL > (X = 0); > > There's no bug here: X is not initialized at this point. Therefore > the value of (X=0) is undefined, > Excuse me???? The value of (X=0) is defined and is 0. Anyway, if you do not believe in C semantics, you could have tried to initialise X before rejecting the bug: extern int printf( const char* args, ... ); % cat tmp.i int main( ) { long long X = 0, Y; Y = -3000000000LL > (X = 0); printf( "%s (%lld)\n", Y != 0 ? "FAIL" : "OK", Y ); return 0; } % gcc tmp.i % a.out FAIL (1) % Wilco.