C++
Read post

PVS-Studio in CMake: It's official now!

CMake 4.3.0 now officially integrates PVS-Studio static analyzer for C and C++ projects. Developers can enable analysis by setting the CMAKE_C_PVS_STUDIO or CMAKE_CXX_PVS_STUDIO directive in CMakeLists.txt, and analyzer warnings will appear alongside compiler output during the build. The post walks through a practical example using the LibreSSL cryptographic library, demonstrating how to configure and run the analysis with Ninja. It also highlights real bugs found in LibreSSL, including a dead assignment that prevents secure memory clearing under optimization and a duplicate condition in an ASN.1 parser. Limitations include no saved report file and no plog-converter support, though results can be aggregated in CDash. Existing analysis methods via compile_commands.json and the CMake module remain available.

    #c#c++
May 18•6m read time•From pvs-studio.com
Post cover image
Table of contents
How does it work?Let's put it into practiceWill the old analysis options remain?
124 Impressions
C++'s image
C++

ISO C++ is the official website for the C++ programming language standardization committee, providin...

571 Followers

•

493 Upvotes

andreykarpov's user avatar
Andrey Karpov
@andreykarpov
Joined Jun 28. 2023
160

Andrey has been dealing with static code analysis and software quality for more than 15 years.

Would you recommend this post?

Copy link
WhatsApp
Facebook
X
New Squad
  • © 2026 Daily Dev Ltd.
  • Guidelines
  • Explore
  • Tags
  • Sources
  • Squads
  • Leaderboard