PVS-Studio 7.31: new C++ analyzer features, enhanced user annotations, and more
PVS-Studio 7.31 has been released. We have so much news to share with you! We’ve enhanced the user annotation system, the mode to analyze individual files, and much more! Learn more release details here.
You can download the latest version of PVS-Studio here.
Enhanced individual file analysis mode
We’ve enhanced the mode to analyze individual files via the — source-files flag in the pvs-studio-analyzer utility.
If you want to know more about the analysis flags, check out it here.
We’ve improved the handling of scenarios in which the compilation dependency cache for C and C++ files differs from the project structure.
This could happen if you often switch branches in one workspace or analyze different project versions.
If you want to learn more about this mode, check out the documentation.
New feature to customize configuration files
The PVS-Studio for C++ now supports setting up the .pvsconfig configuration files based on the analyzer version that uses these files.
If you want to learn more, check out the documentation.
Enhanced user annotation system
The system of user annotations in C++ analyzer now supports setting the constraints of allowed and disallowed values for integer function parameters.
If you want to learn more about the system of user annotations, check out the documentation.
Enhanced CircleCI documentation
We’ve enhanced and updated the documentation on the PVS-Studio integration into the CircleCI cloud CI system.
You can find the enhanced documentation here.
New diagnostic rules
C, C++
- V1108. Constraint specified in a custom function annotation on the parameter is violated.
- V1109. Function is deprecated. Consider switching to an equivalent newer function.
- V1110. Constructor of a class inherited from ‘QObject’ does not use a pointer to a parent object.
C#
- V3199. Index from end operator used with the value that is less than or equal to zero. Index is out of bound.
- V3200. Possible overflow. The expression will be evaluated before casting. Consider casting one of the operands instead.
Java
- V6113. Suspicious division. Absolute value of the left operand is less than the value of the right operand.
- V6114. The ‘A’ class containing Closeable members does not release the resources that the field is holding.
Articles
For C++ programmers:
How much UB is in my compiler?
C++ programmer’s guide to undefined behavior: part 1 of 11
Error on verge of extinction, or why I put if (x = 42) in Red List of C & C++ bugs
What errors are lurking in LLVM code?
Eleven moments of ReactOS: user mode gets better?
Compilation of gripping C++ conference talks from 2023
Let’s check the qdEngine game engine, part one: top 10 warnings issued by PVS-Studio
Let’s check the qdEngine game engine, part two: simplifying C++ code
Let’s check the qdEngine game engine, part three: 10 more bugs
C++: freeing resources in destructors using helper functions
For C# programmers:
Garnet. Does Microsoft’s cache -store also store bugs?
Nephalem’s nightmare. Exploring errors in Diablo 3 server emulator code
For Java programmers:
How template method can ruin your Java code
Volatile, DCL, and synchronization pitfalls in Java
21 bugs in 21st version of Apache NetBeans
Articles on general topics:
Smile while drowning in bugs
New videos
We’ve also got a new series of videos about Andrey Karpov’s mini-book “60 terrible tips for a C++ developer”!
If you can’t wait to dive into the rest of the terrible tips, you can read the full version on our blog.
If you want to write efficient, reliable and well-structured C++ programs, it’s helpful to know about errors and inefficient approaches. Now in video format:
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.