[llvm] r186684 - Initialize TempFileHandle.

Rafael EspĂ­ndola rafael.espindola at gmail.com
Sat Jul 20 07:47:26 PDT 2013


On 19 July 2013 23:27, Serge Pavlov <sepavloff at gmail.com> wrote:
> Using uninitialized variable causes undefined behavior. As discussion in
> http://llvm.org/bugs/show_bug.cgi?id=16642 (Optimization eliminates an
> overflow check) demonstartes, it may be dangerous, if compiler tries to
> optimize. So the initialization was added for safety.

I perfectly understand that we should not have undefined behavior, but
this code had none.

I think Chandler summarized well the problem with adding these
redundant initializations just to silence compiler warnings:

http://lists.cs.uiuc.edu/pipermail/cfe-commits/Week-of-Mon-20130408/077882.html

> In regular build the warning is already turned off, I just experimented with
> compilation out of the tree.
>
> Thanks,
> --Serge

Cheers,
Rafael



More information about the llvm-commits mailing list