📜 ⬆️ ⬇️

We build PVS-Studio in Anjuta DevStudio (Linux)

After the appearance of PVS-Studio under Linux, I tried it on my project, and decided that using this analyzer would not hurt, in addition to all other analyzers.

And as the astrologers announced the week “They started PVS-Studio in their IDE”, I decided to describe how I set up Anjuta DevStudio (http://anjuta.org/). Thanks for the script thanks to kloppspb and his article Embed PVS-Studio in the Eclipse CDT (Linux) .

The script itself is taken from the original article and slightly modified for projects collected using autotools.

pvs-anjuta.sh
#!/bin/sh #      External Tool,   `make clean`: if [ -z "$1" ]; then make clean fi #   ,  : if [ "$2" = "clean" ]; then make clean #      : exit fi #  clean    External Tool -  : TEMPLOG=$(tempfile) #   `strace`,      : pvs-studio-analyzer trace -- make 2>&1 | sed '/strace: umovestr:/d' - pvs-studio-analyzer analyze -o "$TEMPLOG" #   ,       : RC=$(plog-converter -t errorfile "$TEMPLOG" | sed '/The documentation for all/d' -) rm -f "$TEMPLOG" echo "$RC" 


Next, open the project that we want to check, and go to Settings. Next General - the tab "Installed Plugins", and enable the plug-in "Tools" (Tools).
')
Anjuta Preferences


Go to the end of the list of settings to the “Tools” item and create a new tool “PVS-Studio Check”

Tools


And configure the tool as shown in the figure.

Tool editor

As a result, by running the check through the Tools menu, the PVS-Studio Check item, in the standard message window we will be able to receive errors and warnings from the analyzer, and double-click on the required line.

Example

Source: https://habr.com/ru/post/316720/


All Articles