This is the mail archive of the gcc@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: missed uninitialised variable warning


Michael Matz <matz@suse.de> wrote:
>
> Hi,
> 
> On Sun, 3 Aug 2003, Andrew Morton wrote:
> 
> > int foo(void)
> > {
> > 	int i = i;
> > 	return i;
> > }
> 
> That's a feature.  GCC doesn't warn about such self-initialization.  It's
> used to silence GCC warnings in code where the user knows, that the
> variable isn't used uninitialized,

What a perfectly terrible idea that was.

> without generating any code, which
>   int i = 0;
> would do.  There was a proposal to implement that feature with some
> attribute and get rid of the above special meaning for that syntax (which
> I quite like btw ;-))  I don't know if the status of that.

It would be nice.  I'm aware of two bugs across the development of the 2.5
kernel which would not have occurred but for this gcc problem.



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