To get a trial key
fill out the form below
Team License (a basic version)
Enterprise License (extended version)
* By clicking this button you agree to our Privacy Policy statement

Request our prices
New License
License Renewal
--Select currency--
* By clicking this button you agree to our Privacy Policy statement

Free PVS-Studio license for Microsoft MVP specialists
* By clicking this button you agree to our Privacy Policy statement

To get the licence for your open-source project, please fill out this form
* By clicking this button you agree to our Privacy Policy statement

I am interested to try it on the platforms:
* By clicking this button you agree to our Privacy Policy statement

Message submitted.

Your message has been sent. We will email you at

If you haven't received our response, please do the following:
check your Spam/Junk folder and click the "Not Spam" button for our message.
This way, you won't miss messages from our team in the future.

Is it possible to run PVS-Studio in Lin…

Is it possible to run PVS-Studio in Linux?

Jul 16 2012

Sometimes our customers wonder if it is possible to run PVS-Studio in Linux. Today we are ready to tell you about our research regarding this issue.

Good news, friends! Launching PVS-Studio for Linux is possible since October, 2016! You can use the analyzer in Ubuntu, Debian, OpenSUSE, CentOS, Fedora, Gentoo and many other distribution kits, based on the Linux kernel. The analyzer can be installed with the help of a package or unpacked from the archive. You may find more details about the news of PVS-Studio for Linux release by the link. An article describing the development of the analyzer under this platform is available here.

Introduction, or PVS-Studio's anatomy in brief

So, the PVS-Studio code analyzer consists of the following parts:

  • analyzer kernel presented by the PVS-Studio.exe file;
  • a handful of plugins for Visual Studio in the form of a dll set for VS 2012, 2010, 2008 and 2005;
  • external preprocessor cl.exe (from Visual C++), clang.exe (from Clang) or some other preprocessor like gcc.exe (from MinGW).

The preprocessor is required to parse all the #define's and #include's. The results of the preprocessor's work are received by the analyzer kernel (a console application). The analyzer builds the code tree and traverses it to find error patterns it is familiar with. The results of the analyzer's operation are arranged in the form of a set of diagnostic messages and sent to the Visual Studio plugin. It is the plugin that performs additional message filtering, provides you with easy and convenient navigation and many other things.

To launch the tool in another system (that is Linux), you should have at least a preprocessor and the analyzer kernel (the PVS-Studio.exe file) there. So what have we done?

Towards Linux?

Well, we don't have plans to create a native Linux-version of PVS-Studio for now due to commercial reasons first of all. Few people are lucky enough to build up a business on selling tools for Linux developers, and our company is obviously not the one to rush into this pool. However, users sometimes ask us about it, and we have finally decided to investigate this issue.

So, we obviously took the Linux-native gcc as the preprocessor. We were lucky to have had an experience of running the tool under MinGW earlier, which allowed us to make almost no modifications this time. At last, we learned quite quickly to get preprocessed files.

Then we needed to "feed" the preprocessed files to PVS-Studio.exe. This task appeared rather easy to accomplish on a Windows-machine. Of course, there were some issues with file paths and other subtle things, but we managed that in general. Then we found it interesting to run PVS-Studio in the Linux environment itself to easily integrate into Makefile.

We felt reluctant to port the PVS-Studio's code to Linux, as it is a very big and unrewarding task. That's why we took Wine. It allowed us to run the analyzer quite easily and pass several internal tests. After that we started at once to integrate the PVS-Studio call into Makefile of one of the open source projects.

Note that we did all that to a special version of PVS-Studio where we had disabled some features and modified others. That is, you will hardly succeed if you just take PVS-Studio.exe from the distribution pack. In the future, though, the pack will perhaps include the tool version capable of running under Wine right away.

So, we managed to run the tool under Wine in the native Linux environment, having modified the PVS-Studio's code and given it some crutches. At the same time, it was a successful integration into Makefile of a real project, just as we had wished! To know more about how to integrate PVS-Studio into any Makefile and build system, please see the documentation.

After this launch we got a test log-file that can be opened in Visual Studio with PVS-Studio to get a processed plog-file with messages output into the PVS-Studio Output Window. Of course, navigation doesn't work in a Windows system in this case, since the file paths are written in the Unix-format, but you can convert them into the Windows-format manually.

It's the other point which is important: there is a fundamental possibility to launch PVS-Studio under Linux in the native build environment! Moreover, you can actually realize (as a separate task) some UI to handle the text analysis log in Linux - that is, make an analogue of the PVS-Studio Output Window for Linux.

Address to our users

If there are those among our users interested in developing a Linux-oriented version of PVS-Studio and public release of this functionality, please let us know. But don't forget that it will require a large internal development on our side. Because it's just one thing to launch PVS-Studio.exe and pass a couple of projects, and quite another thing to provide full-blown operation of this version and test it on a large number of projects.

Popular related articles
Free PVS-Studio for those who develops open source projects

Date: Dec 22 2018

Author: Andrey Karpov

On the New 2019 year's eve, a PVS-Studio team decided to make a nice gift for all contributors of open-source projects hosted on GitHub, GitLab or Bitbucket. They are given free usage of PVS-Studio s…
The Ultimate Question of Programming, Refactoring, and Everything

Date: Apr 14 2016

Author: Andrey Karpov

Yes, you've guessed correctly - the answer is "42". In this article you will find 42 recommendations about coding in C++ that can help a programmer avoid a lot of errors, save time and effort. The au…
Technologies used in the PVS-Studio code analyzer for finding bugs and potential vulnerabilities

Date: Nov 21 2018

Author: Andrey Karpov

A brief description of technologies used in the PVS-Studio tool, which let us effectively detect a large number of error patterns and potential vulnerabilities. The article describes the implementati…
How PVS-Studio Proved to Be More Attentive Than Three and a Half Programmers

Date: Oct 22 2018

Author: Andrey Karpov

Just like other static analyzers, PVS-Studio often produces false positives. What you are about to read is a short story where I'll tell you how PVS-Studio proved, just one more time, to be more atte…
PVS-Studio for Java

Date: Jan 17 2019

Author: Andrey Karpov

In the seventh version of the PVS-Studio static analyzer, we added support of the Java language. It's time for a brief story of how we've started making support of the Java language, how far we've co…
Appreciate Static Code Analysis!

Date: Oct 16 2017

Author: Andrey Karpov

I am really astonished by the capabilities of static code analysis even though I am one of the developers of PVS-Studio analyzer myself. The tool surprised me the other day as it turned out to be sma…
The Last Line Effect

Date: May 31 2014

Author: Andrey Karpov

I have studied many errors caused by the use of the Copy-Paste method, and can assure you that programmers most often tend to make mistakes in the last fragment of a homogeneous code block. I have ne…
Characteristics of PVS-Studio Analyzer by the Example of EFL Core Libraries, 10-15% of False Positives

Date: Jul 31 2017

Author: Andrey Karpov

After I wrote quite a big article about the analysis of the Tizen OS code, I received a large number of questions concerning the percentage of false positives and the density of errors (how many erro…
Static analysis as part of the development process in Unreal Engine

Date: Jun 27 2017

Author: Andrey Karpov

Unreal Engine continues to develop as new code is added and previously written code is changed. What is the inevitable consequence of ongoing development in a project? The emergence of new bugs in th…
The way static analyzers fight against false positives, and why they do it

Date: Mar 20 2017

Author: Andrey Karpov

In my previous article I wrote that I don't like the approach of evaluating the efficiency of static analyzers with the help of synthetic tests. In that article, I give the example of a code fragment…

Comments (0)

Next comments
This website uses cookies and other technology to provide you a more personalized experience. By continuing the view of our web-pages you accept the terms of using these files. If you don't want your personal data to be processed, please, leave this site.
Learn More →