[PATCH] Fix uninitialized warning in llvm/lib/IR/DataLayout.cpp

Cameron McInally cameron.mcinally at nyu.edu
Tue Jan 7 14:12:26 PST 2014


Hey Rafael,

I don't know. My project has its own build system and build requirements.

Your solution of using report_fatal_error(…) also avoids the warning
with a release build. Is that the preferred fix? Seems like it would
save an initialization, but introduce a runtime check into a release
compiler.

-Cameron

On Tue, Jan 7, 2014 at 3:22 PM, Rafael Espíndola
<rafael.espindola at gmail.com> wrote:
> I thought we explicitly disable this warning because it was too noisy, no?
>
> On 7 January 2014 10:52, Cameron McInally <cameron.mcinally at nyu.edu> wrote:
>> Hey guys,
>>
>> When compiling LLVM with GCC 4.6.3, the following warning appears when
>> the -Wuninitialized option is specified:
>>
>>> llvm/lib/IR/DataLayout.cpp:200:17: warning: 'Result' may be used uninitialized in this function [-Wuninitialized]
>>
>> Attached is a small patch to initialize Result to 0.
>>
>> Tx,
>> Cameron
>>
>> _______________________________________________
>> llvm-commits mailing list
>> llvm-commits at cs.uiuc.edu
>> http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
>>




More information about the llvm-commits mailing list