This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: missed uninitialised variable warning
- From: Michael Matz <matz at suse dot de>
- To: Andrew Morton <akpm at osdl dot org>
- Cc: gcc at gcc dot gnu dot org
- Date: Mon, 4 Aug 2003 13:14:17 +0200 (CEST)
- Subject: Re: missed uninitialised variable warning
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, 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.
Ciao,
Michael.