[compiler-rt] r211008 - [asan] initialze varaibles to avoid a (false positive) report from gcc's -Wmaybe-uninitialized

Kostya Serebryany kcc at google.com
Mon Jun 16 02:36:03 PDT 2014


On Mon, Jun 16, 2014 at 1:24 PM, Chandler Carruth <chandlerc at google.com>
wrote:

>
> On Mon, Jun 16, 2014 at 9:32 AM, Kostya Serebryany <kcc at google.com> wrote:
>
>> Author: kcc
>> Date: Mon Jun 16 03:32:02 2014
>> New Revision: 211008
>>
>> URL: http://llvm.org/viewvc/llvm-project?rev=211008&view=rev
>> Log:
>> [asan] initialze varaibles to avoid a (false positive) report from gcc's
>> -Wmaybe-uninitialized
>>
>
> Rather than this, please just disable the warning. When we do this, we
> lose the ability to use other tools to find *actual* uninitialized memory.
>

I remember this objection well.
First, I am not sure I *completely* agree, because msan and memcheck
require the code to be executed to find a bug, thus they rely on good
tests.
If we initialize the data we have no UB, although may still have a logical
bug; but it is better than UB.
Still, I *almost* agree with this for regular code.

But, second, the objection does not apply to the sanitizers themselves
because neither valgrind nor msan can execute sanitizer's run-time. :(

--kcc
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20140616/677a6146/attachment.html>


More information about the llvm-commits mailing list