Our website uses cookies to enhance your browsing experience.
Accept
to the top
close form

Fill out the form in 2 simple steps below:

Your contact information:

Step 1
Congratulations! This is your promo code!

Desired license type:

Step 2
Team license
Enterprise license
** By clicking this button you agree to our Privacy Policy statement
close form
Request our prices
New License
License Renewal
--Select currency--
USD
EUR
* By clicking this button you agree to our Privacy Policy statement

close form
Free PVS‑Studio license for Microsoft MVP specialists
* By clicking this button you agree to our Privacy Policy statement

close form
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

close form
I am interested to try it on the platforms:
* By clicking this button you agree to our Privacy Policy statement

close form
check circle
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.29: Java code check in VS …

PVS-Studio 7.29: Java code check in VS Code, Boost smart pointers, and plugin for Qt Creator on macOS

Feb 13 2024
Author:

PVS-Studio 7.29 has been released. Now you can analyze Java projects in a plugin for VS Code, check Boost smart pointers, use the PVS-Studio plugin for Qt Creator 12 on macOS, and that's not all! See more details in this note.

1102_7_29/image1.png

You can download the latest PVS-Studio version here.

Support for Java projects in Visual Studio Code plugin

Now you can analyze Java projects using the PVS-Studio plugin for Visual Studio Code. In the plugin, you can:

  • run the analysis and view a report;
  • suppress warnings using suppress files;
  • enable the incremental analysis mode.

You can explore other features in the documentation section.

1102_7_29/image2.png

Support for Boost smart pointers

The C++ analyzer now supports smart pointers from the Boost library: boost::unique_ptr and boost::shared_ptr.

Now the PVS-Studio analyzer is able to detect errors such as null pointer dereferences when these classes are used.

Considering hash of code line to mark false positives

In the latest PVS-Studio release, we added a mode that considers the hash of the source code line, which triggers a warning, when users mark warnings as false positives.

PVS-Studio had considered hash before, but it was used for navigation and the more efficient operation of suppress files. There is now a new way to use the hash: you can specify it inline when marking false positives. This makes it clear whether the line of code had been changed since the warning was marked as a false positive. If there are changes in the code, the false positive marker will no longer suppress the analyzer warning.

Here is an example of a line where the false positive marker and hash for tracking changes are specified:

std::string(4, std::string().at(0)); //-V530 //-VH"920700501"

The PVS-Studio plugins for Microsoft Visual Studio now support this feature. For further details, please refer to the documentation.

Note. If you are interested in learning more about methods and technologies of false positive suppression, you may want to read this article.

PVS-Studio plugin for Qt Creator 12 on macOS

The PVS-Studio plugin for Qt Creator 12 is now supported on macOS operating systems.

You can find more details on how to use PVS-Studio in Qt Creator in the documentation.

New diagnostic rules

C, C++

  • V839. Decreased performance. Function returns a constant value. This may interfere with the move semantics.
  • V1104. Priority of the 'M' operator is higher than that of the 'N' operator. Possible missing parentheses.
  • V2625. MISRA. Identifier with external linkage should be unique.

C#

  • V3194. Calling 'OfType' for collection will return an empty collection. It is not possible to cast collection elements to the type parameter.
  • V3195. Collection initializer implicitly calls 'Add' method. Using it on member with default value of null will result in null dereference exception.

Java

  • V6108. Do not use real-type variables in 'for' loop counters.
  • V6109. Potentially predictable seed is used in pseudo-random number generator.

C++ quiz by PVS-Studio and Sergei Kushnirenko

1102_7_29/image3.png

In this release, the PVS-Studio team together with Sergei Kushnirenko prepared a C++ quiz based on errors described in his publications.

Take the quiz, challenge your focus and coding skills while looking for errors in the C++ code. You can find the quiz here.

Articles

For C++ programmers

For C# programmers:

For Java programmers:

Articles on general topics

Do you want to check a project with PVS-Studio? Then start from this page.

If you would like to get news on latest releases, subscribe to the PVS-Studio newsletter here.

Popular related articles


Comments (0)

Next comments next comments
close comment form