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


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.


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