[swift-dev] PVS-Studio static analysis results for the Swift project

Brian Gesiak modocache at gmail.com
Mon Nov 7 15:56:52 CST 2016

Hello all,

The latest LLVM Weekly <http://llvmweekly.org/issue/149> 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/> of the errors they
encountered in the LLVM project. Although the report contained many false
positives <https://twitter.com/chandlerc1024/status/794442485472706563>,
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

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

- Brian Gesiak
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.swift.org/pipermail/swift-dev/attachments/20161107/e239fa8e/attachment.html>

More information about the swift-dev mailing list