Skip to content

Instantly share code, notes, and snippets.

@GermanAizek
Last active March 4, 2025 18:14
Show Gist options
  • Save GermanAizek/eea8a6f20446f91a8c736d5b43eb5d3e to your computer and use it in GitHub Desktop.
Save GermanAizek/eea8a6f20446f91a8c736d5b43eb5d3e to your computer and use it in GitHub Desktop.
PVS Studio analyze Makefile or Ninja script on Linux
# configure project (Meson)
CC=clang CXX=clang++ meson /tmp/name
# or
# configure project (CMake)
CC=clang CXX=clang++ cmake -B /tmp/name ..
# building with trace (Makefile)
pvs-studio-analyzer trace -- make -j72
# building with trace (Ninja)
pvs-studio-analyzer trace -- ninja
# analyze strace_out or compile_commands.json (Makefile)
pvs-studio-analyzer analyze -j72 --intermodular -a "GA;64;OP" -o PVS.log # CLion and Visual Studio
# analyze strace_out or compile_commands.json (Ninja)
pvs-studio-analyzer analyze -f strace_out -j72 --intermodular -a "GA;64;OP" -o PVS.log # CLion and Visual Studio
# convert report format file
plog-converter -t json -a 'GA;64;OP' -o PVS.json PVS.log # QtCreator
# open PVS.log in IDE (CLion and Visual Studio)
# open PVS.json in IDE (Qt Creator)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment