This is the mail archive of the gcc-patches@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: [Patch] Fix PR 5582 and 10538, missed uninitialized variablewarning


On Sun, 17 Aug 2003 01:00:47 -0400, Andrew Pinski <pinskia@physics.uc.edu> wrote:

> This is a follow up with my pervious patch which did not compile at all in
> any non C language.

> This fixes PR 5582 only when pedantic is on because it as a GCC extension
> to do int i = i; to turn off the uninitialized warnings for that
> variable.

I don't think it makes sense for this to be conditional on -pedantic;
warnings have nothing to do with standards conformance.  As the PR
suggests, this should be controlled by a -Wno- flag.

> I also do not warn about int *x = &x; because x is initialized.

Right.

> There is one case where I warn when we should not: int *x = &(x+2);.

That code is ill-formed; x+2 isn't an lvalue, so you can't take its address.

Jason


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