This is the mail archive of the
mailing list for the GCC project.
Re: -Wuninitialized issues
- From: Joe Buck <Joe dot Buck at synopsys dot COM>
- To: Jeffrey A Law <law at redhat dot com>
- Cc: Diego Novillo <dnovillo at redhat dot com>, gcc at gcc dot gnu dot org,Mark Mitchell <mark at codesourcery dot com>
- Date: Tue, 1 Nov 2005 10:32:20 -0800
- Subject: Re: -Wuninitialized issues
- References: <4365CA5E.email@example.com> <firstname.lastname@example.org> <email@example.com> <firstname.lastname@example.org>
On Tue, Nov 01, 2005 at 11:17:52AM -0700, Jeffrey A Law wrote:
> On Tue, 2005-11-01 at 11:06 -0500, Diego Novillo wrote:
> > To prevent losing location information for the warning, I had modified the
> > propagation engine to warn as it folded the expression away.
> Possibly a useful thing to have, but I don't think we want to put
> the burden of detecting uninitialized variables onto each
> optimizer :-)
Just an off-the-wall idea: What if dereferencing an uninitialized variable
is considered a side effect? Then that side effect must be preserved
unless it is unreachable. Consider
while (i > 0)
// no more uses of i.
Instead of throwing everything away, this would become
and we would still get the warning.