User Svyatoslav Razmyslov runs several tests on the PVS-Studio software to analyze the FreeBSD kernel. Full details of the report can be found in the link below.
PVS-Studio is a tool used to detect bugs in the source code of programs written in C, C++ and C#.
PVS-Studio performs static code analysis and generates a report that helps a programmer find and fix bugs. PVS-Studio does a wide range of code checks; but it is especially useful to search for misprints and Copy-Paste errors. Examples of such errors: V501, V517, V522, V523, V3001.
We used static code analyzer PVS-Studio, version 6.01.
For convenience, I set a PC-BSD and wrote a small utility in C++, which keeps the working environment of the compilers’ runs when building the kernel. The acquired information was used to get the preprocessed files and their analysis, done by PVS-Studio. This method allowed me to quickly check a project without having to study an unfamiliar build system to integrate the analyzer. On top of it, analysis of preprocessed files allows you to do a more in-depth analysis of the code and find more sophisticated and interesting, errors, in macros for instance. This article will provide several examples of such a kind.
Full report: http://www.viva64.com/en/b/0377/