PVS-Studio 7.21 has been released. This short note describes the analyzer's main enhancements and lists our recent articles and quizzes.
You can download PVS-Studio 7.21 here. If you don't have a license key, you can get a trial key here.
So, what's new?
GitLab Code Quality reports
The PVS-Studio analyzer's results now can be converted into reports compatible with GitLab Code Quality. This will help monitor the quality of the project within the GitLab ecosystem.
The documentation on using PVS-Studio in GitLab CI/CD describes how to get a report of this type.
Closer integration with Unreal Engine
We keep enhancing support of Unreal Engine projects. And we have 3 news to share with you:
Improving cross-platform scenarios
The PVS-Studio plugin for Visual Studio now supports JSON suppress files. This format was previously supported only in utilities on Linux and macOS. This simplifies the use of suppress files in cross-platform scenarios. It is also now easier to integrate PVS-Studio in the development process of cross-platform projects that contain legacy code.
New warning suppression features
Now you can automatically filter analyzer warnings whose messages contain the specified text. The feature allows you to suppress specific diagnostics' warnings that match a template — without disabling the diagnostics completely. You can create a filter of this kind in .pvsconfig files (C++, C#) or directly in code (C++ only).
Let's take a look at the following example. The V3022 diagnostic of PVS-Studio for C# is triggered if the expression in code is always true or false.
Here's the code fragment:
static void ProcessStr(String str)
{
if (str == "temp")
{
if (str.Length != 0) // V3022 (expression is always true)
....
if (str.Length == 0) // V3022 (expression is always false)
....
}
}
Let's say we are not going to disable the V3022 diagnostic completely, but we only want to see warnings for conditions that are always false. So, we just need to create the following filter in the .pvsconfig file:
//-V::3022::{always true}
PVS-Studio will filter out V3022 warnings that contain the "always true" text. If you use this filter for the code fragment above, the first warning will be gone, while the second one will remain.
Diagnostic configuration files (.pvsconfig) documentation
Diagnostic configuration files allow to configure the analyzer to fit your needs, for example:
The new documentation section describes all features of .pvsconfig files and how to use these files in different environments.
New diagnostics
C, C++
C#
Quizzes
We made a quiz on "Who you are in C#". You can try it here.
By the way, leave a comment if you managed to get a different result than "You are a garbage collector". Because I don't know if it's me being so unlucky or if we're all being trolled by our C# team... :)
If you missed other activities, here they are:
Articles
For those who code in C++:
For those who code in C#:
Checking projects for bugs:
0