errors

C++ quiz by PVS-Studio and Sergei Kushnirenko

The PVS-Studio team along with Sergei Kushnirenko prepared a quiz based on his publications about errors he found. Take the quiz, challenge your focus and coding skills while looking for errors in the C++ code. Attention! When taking the quiz, you may exclaim that some tasks are unfair. Indeed. However, please relax and approach them with humor. The quiz is just for fun.

C++ quiz by PVS-Studio and Sergei Kushnirenko

by Sergei Kushnirenko

About the quiz:

After taking the quiz, you may have questions about why this or that answer is marked as correct or incorrect. Welcome to the article: "Breaking down the C++ quiz by Sergei Kushnirenko" — here you will find answers to your questions.  Please read it only after you have puzzled over code snippets with errors and undefined behavior. Be sure — it will be more interesting.

PVS-Studio 6.16 released

PVS-Studio is a static code analyzer that detects errors and potential vulnerabilities in the source code of programs written in C/C++/C#. Version 6.16 has obtained 11 new general analysis diagnostics.

PVS-Studio 6.16 released

by Andrey Karpov

About the release:

In a sense, this is a milestone for us. The thing is that we cannot add more numbers of general analysis warnings, otherwise they will concur with the numbers of micro-optimization diagnostics. It seemed to us that the list of 300 diagnostics was endless, but now it is over and we got to the point of 800, where we have micro-optimization diagnostics. In the next release we plan to resume numbering the general-analysis warnings with V1000. Download and enjoy the new version of PVS-Studio now by clicking here.

P.S. How to use PVS-Studio for Free.

New updates of CppHints.com, service of recommendations on C++ programming from PVS-Studio team

New updates of C++Hints, service of recommendations on C++ programming

Changes in CppHints.com

by PVS-Studio Team

We got a lot of positive feedback from our readers and continue developing the C++Hints project. We have also answered two requests, that we saw quite often in the letters:

By this moment we have published the following articles:

The compiler is to blame for everything -- Andrey Karpov

Many programmers are very fond of blaming the compiler for different errors. Let's talk about it.

The compiler is to blame for everything

by Andrey Karpov

From the article:

When a programmer tells you that the compiler causes an error, it is a lie in 99% of cases. When you start investigating the problem, you usually find out the following reasons:

  • an array overrun;
  • an uninitialized variable;
  • a misprint;
  • a synchronization error in a parallel program;
  • a non-volatile variable used;
  • code leading to undefined behavior;
  • etc.