pvs-studio-analyzer intel/libva@8575b2b
denji opened this issue · 0 comments
denji commented
$ docker run -it --rm docker.io/library/ubuntu:22.04 bash
# https://pvs-studio.com/en/pvs-studio/download/
# - RPM https://cdn.pvs-studio.com/pvs-studio-7.26.73915.332-x86_64.rpm
# - Deb https://cdn.pvs-studio.com/pvs-studio-7.26.73915.332-amd64.deb
# - Binary tarball https://cdn.pvs-studio.com/pvs-studio-7.26.73915.332-x86_64.tgz
$ wget 'https://cdn.pvs-studio.com/pvs-studio-7.26.73915.332-amd64.deb'
$ dpkg -i 'pvs-studio-7.26.73915.332-amd64.deb'
$ pvs-studio-analyzer credentials (email) (license) # free opensource https://pvs-studio.com/en/blog/posts/0600/
$ git clone https://github.com/intel/libva.git
$ cd libva
$ git checkout 8575b2b
Note: switching to '8575b2b'.
$ git rev-parse --verify --short HEAD
8575b2b
$ meson ./build/ -Dwith_x11=yes \
-Dwith_legacy=emdg,nvctrl,fglrx -Dwith_win32=no \
-Dwith_glx=yes \
-Dprefix=/usr -Dlibdir=/usr/lib64
$ ninja -Cbuild
$ ninja -C./build/ -t compdb > compile_commands.json
# -a [MODE], --analysis-mode [MODE]
# MODE defines the group of warnings that will be activated during
# analysis:
# 64 - diagnostics, allowing to detect specific errors, related to the development of 64-bit applications and migrating the code from a 32-bit platform to a 64-bit one.
# GA - General Analysis diagnostics. This is the main set of diagnostic rules
# OP - Diagnostics of micro-optimization. These are tips concerning the improvement of efficiency and safety of the code.
# CS - Customers Specific Requests;
# MISRA - a set of diagnostics, developed according to the MISRA standard (Motor Industry Software Reliability Association). This set of diagnostics is disabled by default.
# AUTOSAR - AUTOSAR guidelines;
# OWASP - OWASP guidelines.
# Several types of warnings must be separated by ';', e.g. 'GA;OP;64'.
# Default: GA
# https://pvs-studio.com/en/docs/manual/6615/
$ pvs-studio-analyzer analyze -j4 -a '64;GA;OP;CS;MISRA;AUTOSAR;OWASP' -o libva_pvs_analyze.proj
$ plog-converter -a 'GA;OP;64;CS;MISRA' -t errorfile -o libva_pvs_analyze.log libva_pvs_analyze.proj