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

Eli Bendersky eliben at google.com
Tue Feb 26 15:50:06 PST 2013


>> 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?

Eli



More information about the llvm-commits mailing list