Blog

  • The Little Unicorn That Could

    22.06.2016
    One of the Microsoft development teams already uses PVS-Studio analyzer in their work. It's great, but it's not enough. That's why I keep demonstrating how static code analysis could benefit developers, using Microsoft projects as examples. We scanned Casablanca project three years ago and found nothing. As a tribute to its high quality, the project was awarded with a "bugless code" medal. As time went by, Casablanca developed and grew. PVS-Studio's capabilities, too, have significantly improved, and now I've finally got the opportunity to write an article about errors found by the analyzer in Casablanca project (C++ REST SDK). These errors are few, but the fact that their number is still big enough for me to make this article, does speak a lot in favor of PVS-Studio's effectiveness. Read more
  • Showing abilities of PVS-Studio analyzer by examples of Microsoft open-source projects

    18.05.2016
    Microsoft gradually started to open the code of some projects. Our team is very happy about this. We support the view that Microsoft Company has really high-quality code. What's more, Microsoft developers are already using static code analyzers. That's why finding bugs in their code is a great way to demonstrate the abilities of the analyzer. Read more
  • Explanation about the PVS-Studio demo-version limitations

    06.05.2016
    Usually limitations have two purposes. The first - to show a potential user that a static analyzer is able to find bugs in the code. The second - to prompt the user to communicate with us via e-mail so that we could help use the tool correctly. I am convinced that this interrelation is not clear yet, that's why I've decided to write this little note. Read more
  • The Ultimate Question of Programming, Refactoring, and Everything

    14.04.2016
    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 author is Andrey Karpov - technical director of "Program Verification Systems", a team of developers, working on PVS-Studio static code analyzer. Having checked a large number of open source projects, we have seen a large variety of ways to shoot yourself in the foot; there is definitely much to share with the readers. Every recommendation is given with a practical example, which proves the currentness of this question. These tips are intended for C/C++ programmers, but usually they are universal, and may be of interest for developers using other languages. Read more
  • Detecting Overflows of 32-Bit Variables in Long Loops in 64-Bit Programs

    22.03.2016
    One of the problems that 64-bit software developers have to face is overflows of 32-bit variables in very long loops. PVS-Studio code analyzer is very good at catching issues of this type (see the Viva64 diagnostic set). A lot of questions concerning variable overflows are asked at StackOverflow.com. But since my answers may be treated as pure advertisement, rather than useful reference information, I decided to write an article where I could talk about PVS-Studio's capabilities. Read more
  • Undefined behavior is closer than you think

    05.02.2016
    Some people think that undefined behavior is caused only by gross errors (accessing outside the bounds of the array, for instance) or inadequate constructions (i = i++ + ++i, for example). That's why it is quite surprising when a programmer sees undefined behavior in the code that used to work correctly, without arousing any suspicion. One should never let his guard down, programming in C/C++. Because hell is closer than you may think. Read more
  • C#, PVS-Studio, ReSharper

    03.02.2016
    There is one question that we constantly get asked: "Does it make sense to use PVS-Studio static code analyzer, if we already have ReSharper?". Programmers probably expect to see an article with the comparison of these tools, according to their ability to find bugs in programs. But we reckon that such an article won't clarify the situation; and we'll explain why. However, the question is raised so often that it should be answered. The answer is yes, it makes sense. I should warn you that you won't find a comparison of these tools here. However, if you take just 10 minutes to read this article to its end, you will understand the way we see the situation. Read more
  • Avoid adding a new library to the project

    15.01.2016
    Suppose, you need to implement an X functionality in your project. Theorists of software development will say that you have to take the already existing library Y, and use it to implement the things you need. Suppose, you need to implement an X functionality in your project. Theorists of software development will say that you have to take the already existing library Y, and use it to implement the things you need. In fact, it is a classic approach in the software development - reusing your own or others' previously created libraries (third-party libraries). And most of the programmers go this way. Read more
  • New Year PVS-Studio 6.00 Release: Scanning Roslyn

    23.12.2015
    The long wait is finally over. We have released a static code analyzer PVS-Studio 6.00 that supports the analysis of C# projects. It can now analyze projects written in languages C, C++, C++/CLI, C++/CX, and C#. For this release, we have prepared a report based on the analysis of open-source project Roslyn. It is thanks to Roslyn that we were able to add the C# support to PVS-Studio, and we are very grateful to Microsoft for this project. Read more
  • The most dangerous function in the C/C++ world

    03.12.2015
    After checking hundreds of C/C++ projects of various types, I can claim: memset() is the most inefficient and dangerous function. Most errors that I see in projects are related to the usage of this particular memset() function. I understand that my conclusion is probably neither a revolutionary one, nor an extremely useful one, but I think our readers would be interested to find out why I have come to it. Read more