[cfe-dev] Build Errors

Chandler Carruth chandlerc at google.com
Wed Feb 29 13:39:31 PST 2012

On Wed, Feb 29, 2012 at 1:38 PM, David Blaikie <dblaikie at gmail.com> wrote:

> On Wed, Feb 29, 2012 at 1:22 PM, Chandler Carruth <chandlerc at google.com>
> wrote:
> > I really would like to avoid silencing the GCC "may be used
> uninitialized"
> > warnings by introducing unnecessary initialization.
> >
> > These warnings are almost always false positives due to the way the
> warning
> > was implemented. What it means is that GCC has been unable to *prove*
> > initialization took place, and has not hit one of a (very short) list of
> > known impossible cases. This warning was bad enough that we (Google)
> lobbied
> > upstream and I believe it is now under a separate flag from
> -Wuninitialized.
> >
> > Every time we add initializations like this we achieve three things:
> >
> > 1) placate a fundamentally flawed warning
> > 2) slow down code in some cases (the ability to eliminate the
> initialization
> > corresponds to when this warning *doesn't* fire)
> > 3) prevent us from ever getting Valgrind errors if we in fact introduce a
> > bug leaving the variable uninitialized.
> >
> > It is #3 that makes me really bothered by the spirit of these changes. I
> > would like to recommend anyone using an older GCCs should simply disable
> > -Wuninitialized.
> Should we add some handling for this in the LLVM build if that's the
> case/achievable/sufficiently useful?

While I'm not personally motivated to add this (I think most developers
should self-host most of the time, turning off -Werror in the bootstrap
phase isn't a burden then), I'm not opposed to it and would be happy to
review patches to that effect.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-dev/attachments/20120229/6b7eedef/attachment.html>

More information about the cfe-dev mailing list