gcc-patches@gcc.gnu.org
[Top] [All Lists]

Re: [gcc-in-cxx] Don't initialize variable to itself

Subject: Re: [gcc-in-cxx] Don't initialize variable to itself
From: Ian Lance Taylor
Date: Wed, 04 Mar 2009 08:43:59 -0800
Andrew Pinski <pinskia@xxxxxxxxx> writes:

> On Wed, Mar 4, 2009 at 8:31 AM, Ian Lance Taylor <iant@xxxxxxxxxx> wrote:
>> I committed this patch to the gcc-in-cxx branch to avoid initializing a
>> variable to itself. ÂThis avoids a warning from the C++ frontend.
>
> int a = a; should really disable the unitialized warning even in the
> C++ front-end.  If it is not then it is a bug.

It's not an uninitialized warning.  It's
   warning: operation on 'alloc' may be undefined
It's being generated by -Wsequence-point.

I haven't looked into why the C++ frontend generates the warning when
the C frontend doesn't.

Ian

<Prev in Thread] Current Thread [Next in Thread>