[llvm-commits] [llvm] r160170 - /llvm/trunk/include/llvm/Support/CommandLine.h

Chandler Carruth chandlerc at google.com
Mon Jul 16 06:10:54 PDT 2012


On Mon, Jul 16, 2012 at 6:02 AM, Alexander Kornienko <alexfh at google.com>wrote:

>
> On Fri, Jul 13, 2012 at 3:06 PM, Duncan Sands <baldrick at free.fr> wrote:
>
>> Hi Alexander,
>> > Initializers for some fields were missing in Option::Option
>>
>> did it matter?  If so, please add a testcase.  If not, why this change?
>>
> This did matter. It caused random crashes in case cl::opt was a member of
> non-POD class.
>

Hold on, a *member*? 'cl::opt' objects are supposed to be globals, not
members.

Also, please get LLVM patches reviewed on llvm-commits, not cfe-commits.


> And I always considered it obvious that uninitialized data is bad. Don't
> you think so?
>

No, uninitialized data is fine. It's *using* uninitialized data that is
bad, and we have tools such as valgrind to detect those bugs. If you
blindly initialize data, it prevents tools like valgrind from finding real
bugs in code where data was read inappropriately.


A test case which fails under valgrind is the classic way of exercising
bugs here if this is a bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20120716/f8d2f324/attachment.html>


More information about the llvm-commits mailing list