Virtual function calls in constructors and destructors (C++)

In different programming languages, the behavior of virtual functions differs when it comes to constructors and destructors. Incorrect use of virtual functions is a classic mistake. Developers often use virtual functions incorrectly. In this article, we discuss this classic mistake.

Continue reading

C++ for Beginners: Tips to Write Better Code

When you are just starting to learn how to code, sometimes you may need practical tips from more experienced developers. What is a best practice for a specific scenario? What do you need to avoid? How to write better code? We took it upon us to help you out. Here’s a selection of 8 tips for beginner C++ developers.

Have fun watching this video and coding 🙂

Why we need dynamic code analysis: the example of the PVS-Studio project 

In May 2021, CppCast recorded a podcast called ABI stability (CppCast #300). In this podcast, Marshall Clow and the hosts discussed rather old news — Visual Studio compilers support the AddressSantitzer tool. We have already integrated ASan into our testing system a long time ago. Now we want to tell you about a couple of interesting errors it found.

Continue reading

Static analysis protects your code from time bombs

Static code analysis allows you to identify and eliminate many defects at an early stage. Moreover, it’s possible to detect dormant errors that don’t show themselves when they appear. They can cause many problems in the future and it requires many hours of debugging to detect them. Let’s look at an example of such a dormant error.

Continue reading

How to Use Mass Suppression in PVS-Studio for C++?

Have you just run the analyzer and now you have no idea what to do with all this abundance of warnings? 📜 Nothing to worry about – we made a special mechanism that can help you deal with them 💪🏻

In this video, you’ll learn about the inner workings of mass warnings suppression mechanism in PVS-Studio for C++. If you’re interested in other programming language, follow the links bellow 🙂

Mass Suppression in PVS-Studio for C#

Mass Suppression in PVS-Studio for Java

Have fun watching this video and coding 🙂

MISRA C: struggle for code quality and security

A couple of years ago the PVS-Studio analyzer got its first diagnostic rules to check program code compliance with the MISRA C and MISRA C++ standards. We collected feedback and saw that our clients were interested in using the analyzer to check their projects for MISRA compliance. So, we decided to further develop the analyzer in this direction. The article covers the MISRA C/C++ standard and the MISRA Compliance report. It also shows what we already managed to do and what we plan to achieve by the end of the year.

Continue reading