PVS-Studio static analysis results for the Swift project

Hello all,

The latest LLVM Weekly <http://llvmweekly.org/issue/149&gt; featured a blog
post by some folks who make a static analyzer named PVS-Studio. They
published a blog post <http://www.viva64.com/en/b/0446/&gt; of the errors they
encountered in the LLVM project. Although the report contained many false
positives <https://twitter.com/chandlerc1024/status/794442485472706563&gt;,
some did lead to code improvements.

I tried running the analyzer on the Swift codebase; here are the results:

It's a little hard to read, but there are some legitimate issues in the
report. For example, line #709 in lib/IDE/TypeReconstruction.cpp returns
'false' for a method that has a return type of 'size_t', which is probably
incorrect.

If you're interested in contributing to Swift, why not start by fixing some
of these warnings? :)

- Brian Gesiak

Hi Brian,

I know you sent this out 7 days ago, but thanks very much for doing this!

Ted

···

On Nov 7, 2016, at 1:56 PM, Brian Gesiak via swift-dev <swift-dev@swift.org> wrote:

Hello all,

The latest LLVM Weekly <http://llvmweekly.org/issue/149&gt; featured a blog post by some folks who make a static analyzer named PVS-Studio. They published a blog post <http://www.viva64.com/en/b/0446/&gt; of the errors they encountered in the LLVM project. Although the report contained many false positives <https://twitter.com/chandlerc1024/status/794442485472706563&gt;, some did lead to code improvements.

I tried running the analyzer on the Swift codebase; here are the results: PVS-Studio warnings from apple/swift, based off of revision https://github.com/apple/swift/commit/6edb5132d8230b66f4cdcd12154379ab3fcd98e5 · GitHub

It's a little hard to read, but there are some legitimate issues in the report. For example, line #709 in lib/IDE/TypeReconstruction.cpp returns 'false' for a method that has a return type of 'size_t', which is probably incorrect.

If you're interested in contributing to Swift, why not start by fixing some of these warnings? :)

- Brian Gesiak

_______________________________________________
swift-dev mailing list
swift-dev@swift.org
https://lists.swift.org/mailman/listinfo/swift-dev