[llvm-dev] PVS-Studio analysis of LLVM code

Jonas Wagner via llvm-dev llvm-dev at lists.llvm.org
Tue Nov 1 03:26:21 PDT 2016


Hi Eugene,

I think this is really cool! You've convinced me to try out PVS on some of
my own projects :)

Of all the warnings presented in the article, there was one for which I
thought it's a false positive. By default, LLVM is compiled without RTTI
and exceptions. Because of this, I reasoned that operator new would not
throw an exception, and so the checks of its result against nullptr were
correct... right?

Turns out I'm probably wrong. At least according to this stack overflow post
<https://stackoverflow.com/questions/6049563/with-fno-exceptions-what-happens-with-new-t>.
But then, what is the correct way to use operator new when compiling with
-fno-exceptions? Do we need to add (std::nothrow) to all uses of `new`?

Best,
Jonas

On Mon, Oct 31, 2016 at 6:49 PM Eugene Zelenko via llvm-dev <
llvm-dev at lists.llvm.org> wrote:

> Hi!
>
> Company behind PVS-Studio analyzed relatively recent version of LLVM
> and some results are reported in http://www.viva64.com/en/b/0446/.
>
> Eugene.
> _______________________________________________
> LLVM Developers mailing list
> llvm-dev at lists.llvm.org
> http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20161101/0e55bea7/attachment.html>


More information about the llvm-dev mailing list