To get a trial key
fill out the form below
Team License (standard version)
Enterprise License (extended version)
* By clicking this button you agree to our Privacy Policy statement

** This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.
Request our prices
New License
License Renewal
--Select currency--
USD
EUR
GBP
RUB
* By clicking this button you agree to our Privacy Policy statement

** This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.
To get the licence for your open-source project, please fill out this form
* By clicking this button you agree to our Privacy Policy statement

** This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.
To get the licence for your open-source project, please fill out this form
* By clicking this button you agree to our Privacy Policy statement

** This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.
I am interested to try it on the platforms:
* By clicking this button you agree to our Privacy Policy statement

** This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.
Message submitted.

Your message has been sent. We will email you at


If you haven't received our response, please do the following:
check your Spam/Junk folder and click the "Not Spam" button for our message.
This way, you won't miss messages from our team in the future.

>
>
PVS-Studio 7.08

PVS-Studio 7.08

Jun 30 2020

PVS-Studio is the analyzer that searches for bugs in programs written in C, C++, C#, and Java. The PVS-Studio 7.08 release includes a lot of new exciting features. The C# analyzer, in addition to working on the Windows OS, now also works on Linux and macOS. It is now possible to output analysis results in the TeamCity format. The Perforce system is supported in the utility for automatic notification of developers. The plugin for the JetBrains Rider development environment is now available. In the PVS-Studio Java analyzer, you can search for Java SE API compatibility problems. Let's look at these new features in more detail in the article.

0745_Release_7_08/image1.png

C# analyzer for Linux and macOS

At the end of April, we started beta testing of the C# analyzer for Linux and macOS. It was quite successful: we collected feedback, made a number of improvements and fixes.

Now finally, we are releasing the analyzer version comprising the C# analyzer for Linux and macOS! Thus, now the C# analyzer, as well as C, C++, and Java analyzers, is available under all platforms supported by PVS-Studio - Windows, Linux, and macOS.

The command-line utility for analyzing C# projects under Linux \ macOS is called pvs-studio-dotnet. The features of installing and using the analyzer are described in the corresponding sections of the documentation:

PVS-Studio plugin for the JetBrains Rider IDE

On the sidelines of the development and testing of the C# analyzer for Linux and macOS, we have also been developing the PVS-Studio plugin for JetBrains Rider. A no less positive news is that it's also included in the release and is available under all supported platforms: Windows, Linux, macOS.

For more information about installing and using the plugin, see the documentation section "Using PVS-Studio with JetBrains Rider".

New analysis mode of pull requests \ merge requests \ commits

In the Windows version of the analyzer, in the PVS-Studio_Cmd command line utility, a new mode of checking the specified list of files has been added, which is useful for setting up automatic checking of pull \ merge requests and commits.

Despite the fact that previous analyzer versions already had a similar mode, working with it wasn't the most convenient, especially for C++ projects.

Firstly, in the case of analyzing both C++ and C# projects, an XML file was required to specify the list of files for analysis (via the --sourceFiles flag). In other words, it had to be formed in a special way from the list of files in PR, MR, and a commit. This adds an additional step.

Secondly, let's say source files had to be analyzed based on .h files. That is the .h file is changed, you need to analyze all files where it was included explicitly or indirectly. Previously the presence of build system artifacts (tlog files) was required. In addition, one had to first get these files when building the project being checked.

Now it is much easier and more convenient to use this mode – you don't need any tlog files or special XML files. One can simply use the same --sourceFiles flag to send a simple text file with a list of files for analysis. That's it, no tlog files! To solve the problem of storing dependencies, the analyzer now creates a special cache of dependencies between the header and source files, instead of using tlog files, which greatly simplifies this mode of use.

This mode is described in more detail in the section "Setting individual files for checking" in the documentation section "Analyzing Visual Studio / MSBuild / .NET Core projects from the command line using PVS-Studio".

Other improvements and additions

  • The PVS-Studio_Cmd and pvs-studio-dotnet utilities now allow you to pass. pvsconfig files via command-line arguments (--rulesConfig (-C)).
  • Output format for TeamCity was added in a plog-converter - a utility for converting logs on Linux and macOS. In the last release, this output format was added in the PlogConverter for Windows.
  • We have annotated a lot of methods from the Unity libraries, which will allow the C# analyzer to have more information about these methods, and as a result – to conduct more accurate analysis of Unity projects.
  • The blame-notifier utility for automatic developers notification now supports yet another version control system - Perforce. Thus, now the blame-notifier can work with the following VCS: Git, SVN, Mercurial, and Perforce. In addition, it can now automatically get a list of report recipients for Perforce.
  • In Unreal Engine 4.25, it is now possible to use various groups of PVS-Studio diagnostic rules (previously, only the "General Analysis" group was available). For information on how to enable various groups of diagnostics, see the corresponding section of the documentation.

New diagnostic rules

Added nine diagnostic rules. Among them, the V6078 diagnostics clearly deserves more attention, and we'll look at it separately in the next section.

C, C++:

  • V824. It is recommended to use the 'make_unique/make_shared' function to create smart pointers.
  • V825. Expression is equivalent to moving one unique pointer to another. Consider using 'std::move' instead.
  • V1056. The predefined identifier '__func__' always contains the string 'operator()' inside function body of the overloaded 'operator()'.
  • V1057. Pseudo random sequence is the same at every program run. Consider assigning the seed to a value not known at compile-time.
  • V1058. Nonsensical comparison of two different functions' addresses.

Java:

  • V6078. Potential Java SE API compatibility issue.
  • V6079. Value of variable is checked after use. Potential logical error is present. Check lines: N1, N2.
  • V6080. Consider checking for misprints. It's possible that an assigned variable should be checked in the next condition.
  • V6081. Annotation that does not have 'RUNTIME' retention policy will not be accessible through Reflection API.

V6078 - Potential Java SE API compatibility issue

Dalia Abo Sheasha's talk "Migrating beyond Java 8", which we heard at the autumn Joker 2019 conference, inspired us to implement a new diagnostic rule that allows us to detect incompatibilities in the Java SE API between different versions of Java.

At the moment, Java SE 14 has already been released. Despite this, many companies continue using previous Java versions (Java SE 6, 7, 8,...). As time passes and Java is constantly updating, the problem of compatibility of different versions of Java SE API becomes more urgent every year.

When new versions of Java SE are released, they are usually backward compatible with earlier versions. For example, an application developed on the basis of Java SE 8 should run on Java version 11 without problems. However, in practice, some incompatibilities may occur in a number of classes and methods. This incompatibility is due to the fact that some APIs undergo changes: they are deleted, their behavior changes, they are marked as outdated, and much more.

This problem will only get worse when you start thinking about porting your project to a newer Java SE. Or when the technical support of your app will receive more and more emails saying that the app behaves incorrectly or can't start at all.

To help solve this problem, we added the "big" V6078 diagnostic rule to the analyzer. For a more detailed story of this diagnostic development, see the article "The PVS-Studio analyzer: detecting potential compatibility issues with Java SE API".

P.S. Compiler Explorer (godbolt.org)

Around the same time with the release, we made PVS-Studio friends with Compiler Explorer. Of course, this doesn't directly relate to the release, but I would like to mention this to those who missed this news.

Thanks to the Compiler Explorer project, you can quickly get ready with synthetic examples of C and C++ code, and see how the PVS-Studio analyzer reacts on them.

Check out and try: Online examples (C, C++).

Additional links

Popular related articles
The Evil within the Comparison Functions

Date: May 19 2017

Author: Andrey Karpov

Perhaps, readers remember my article titled "Last line effect". It describes a pattern I've once noticed: in most cases programmers make an error in the last line of similar text blocks. Now I want t…
How PVS-Studio Proved to Be More Attentive Than Three and a Half Programmers

Date: Oct 22 2018

Author: Andrey Karpov

Just like other static analyzers, PVS-Studio often produces false positives. What you are about to read is a short story where I'll tell you how PVS-Studio proved, just one more time, to be more atte…
PVS-Studio for Java

Date: Jan 17 2019

Author: Andrey Karpov

In the seventh version of the PVS-Studio static analyzer, we added support of the Java language. It's time for a brief story of how we've started making support of the Java language, how far we've co…
The way static analyzers fight against false positives, and why they do it

Date: Mar 20 2017

Author: Andrey Karpov

In my previous article I wrote that I don't like the approach of evaluating the efficiency of static analyzers with the help of synthetic tests. In that article, I give the example of a code fragment…
The Last Line Effect

Date: May 31 2014

Author: Andrey Karpov

I have studied many errors caused by the use of the Copy-Paste method, and can assure you that programmers most often tend to make mistakes in the last fragment of a homogeneous code block. I have ne…
Free PVS-Studio for those who develops open source projects

Date: Dec 22 2018

Author: Andrey Karpov

On the New 2019 year's eve, a PVS-Studio team decided to make a nice gift for all contributors of open-source projects hosted on GitHub, GitLab or Bitbucket. They are given free usage of PVS-Studio s…
The Ultimate Question of Programming, Refactoring, and Everything

Date: Apr 14 2016

Author: Andrey Karpov

Yes, you've guessed correctly - the answer is "42". In this article you will find 42 recommendations about coding in C++ that can help a programmer avoid a lot of errors, save time and effort. The au…
PVS-Studio ROI

Date: Jan 30 2019

Author: Andrey Karpov

Occasionally, we're asked a question, what monetary value the company will receive from using PVS-Studio. We decided to draw up a response in the form of an article and provide tables, which will sho…
Appreciate Static Code Analysis!

Date: Oct 16 2017

Author: Andrey Karpov

I am really astonished by the capabilities of static code analysis even though I am one of the developers of PVS-Studio analyzer myself. The tool surprised me the other day as it turned out to be sma…
Characteristics of PVS-Studio Analyzer by the Example of EFL Core Libraries, 10-15% of False Positives

Date: Jul 31 2017

Author: Andrey Karpov

After I wrote quite a big article about the analysis of the Tizen OS code, I received a large number of questions concerning the percentage of false positives and the density of errors (how many erro…

Comments (0)

Next comments

This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.
This website uses cookies and other technology to provide you a more personalized experience. By continuing the view of our web-pages you accept the terms of using these files. If you don't want your personal data to be processed, please, leave this site.
Learn More →
Accept