[llvm] r176134 - Try to get rid of a -wunitialized warning: explicitly initialize the pointer

Chandler Carruth chandlerc at google.com
Tue Feb 26 15:54:57 PST 2013


On Tue, Feb 26, 2013 at 3:50 PM, Eli Bendersky <eliben at google.com> wrote:

> >> URL: http://llvm.org/viewvc/llvm-project?rev=176134&view=rev
> >> Log:
> >> Try to get rid of a -wunitialized warning: explicitly initialize the
> >> pointer
> >> to NULL and use asserts to check in relevant places.
> >
> >
> > I assume GCC's -Wuninitialized?
> >
> > I thought we turned that off due to the false positives like this.
> >
>
> Yes, gcc 4.6.3. This is after a vanilla cmake+ninja configure and build.
>
> > I'm really opposed to littering the code with dead stores to placate this
> > warning. It undermines our ability to use Valgrind to catch actual
> > uninitialized bugs.
>
> In this case I initialized the pointer to NULL and added asserts, so
> hopefully any real mis-usage will be detected easily?
>

Until someone else fails to add the assert.

I'd rather have a consistent practice here.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20130226/7b1b6662/attachment.html>


More information about the llvm-commits mailing list