[LLVMdev] [cfe-dev] LTO "bug" and Clang warnings

David Blaikie dblaikie at gmail.com
Tue Jan 8 11:15:20 PST 2013

On Tue, Jan 8, 2013 at 11:11 AM, Renato Golin <renato.golin at linaro.org> wrote:
> On 8 January 2013 18:40, Matthieu Monrocq <matthieu.monrocq at gmail.com>
> wrote:
>> I do believe it's undefined.
>> §5.2.1 Subscripting [expr.sub]
>> ...
>> §5.7 Additive operators [expr.add]
>> ...
> Still, doesn't explicitly say it's undefined.

That's the fun of it - all the things that aren't defined are
undefined. (but, yes, some things are more explicitly undefined than

> I agree this gives the freedom
> of implementers to extend naturally, but it's at least arguable. I have the
> 2011 draft and couldn't find anything, nor in the current open issues.
>> Obviously, a warning, if possible, could be nice; but in general I am
>> afraid this is more the domain of static analysis as it requires "guessing"
>> the bounds of the loop. It might have been caught with ubsan though (I think
>> there is an out-of-bounds checker).
> Is the static analyser in clang-extra-tools?

No, it's built into clang itself, actually. clang -analysis or
somesuch, I've not run it myself, actually.
http://clang-analyzer.llvm.org/ should have some details.

More information about the llvm-dev mailing list