Pull to refresh
196.03

C++ *

General-purpose programming language. It has imperative, object-oriented and generic programming features, while also providing facilities for low-level memory manipulation

Show first
Rating limit
Level of difficulty

Checking BitTorrent in honor of the 20th anniversary. Time == quality

Reading time9 min
Views885

Couple of weeks ago (or to be more precise, on July 2, 2021), the legendary BitTorrent protocol turned twenty years old. Created by Bram Cohen, the protocol has been developing rapidly since its inception, and has quickly become one of the most popular ways to exchange files. So why not check out a couple of long-lived related projects with the PVS-Studio analyzer for Linux?


0846_BitTorrent/image1.png

Read more →
Total votes 5: ↑4 and ↓1+3
Comments0

PVS-Studio Team: Switching to Clang Improved PVS-Studio C++ Analyzer's Performance

Reading time4 min
Views986

From the earliest days, we used MSVC to compile the PVS-Studio C++ analyzer for Windows - then, in 2006, known as Viva64, version 1.00. With new releases, the analyzer's C++ core learned to work on Linux and macOS, and we modified the project's structure to support CMake. However, we kept using the MSVC compiler to build the analyzer's version for Windows. Then, in 2019, on April 29th, Visual Studio developers announced they had included the LLVM utilities and Clang compiler in the IDE. And just recently we've gotten around to try it.

Read more
Total votes 5: ↑3 and ↓2+1
Comments0

Breadth/Depth First Search

Reading time6 min
Views4.9K

A graph is a kind of data structure that includes a set of vertices and edges. Graph traversing means a visit to each vertex of the graph precisely. The graph traversing is used to determine the order in which vertices are being visited throughout the search process. A graph traversing searches for the edges that will be used in the search operation without establishing loops. This means that using graph traversal, we will go to all the vertices of the graph without going into a looping path.

There are two kinds of graph traversal methods.

Читать далее
Total votes 2: ↑1 and ↓10
Comments2

Stack And Queue

Reading time7 min
Views2.6K

Stack

Stack is a linear data structure. In stack, data access is limited. It follows the rule of insertion and deletion of data. Stack is a collection of only similar data types. Elements in the stack are arranged sequentially. It follows the LIFO principle which is the last-in and first-out rule.

Example

To understand this concept, let us take an example of arranging coins. If we start placing coins one after the other in such a way that the first coin will be placed first at the bottom and the next coin will come on above the first coin and so on. Now if we want to remove coins, then the topmost coin which is the third coin will be removed first. So in this way, the last coin will be removed first according to the LIFO principle.

Читать далее
Total votes 2: ↑2 and ↓0+2
Comments0

IncrediBuild: How to Speed up Your Project's Build and Analysis

Reading time7 min
Views1.3K

"How much longer are you going to build it?" - a phrase that every developer has uttered at least once in the middle of the night. Yes, a build can be long and there is no escaping it. One does not simply redistribute the whole thing among 100+ cores, instead of some pathetic 8-12 ones. Or is it possible?

Читать далее
Rating0
Comments0

MacOS Kernel, How Good Is This Apple?

Reading time19 min
Views1.5K

0818_XNU_MacOS_Kernel/image1.png


At the very beginning of this year, Apple released the source code for macOS – Big Sur. It includes XNU, the kernel of the macOS operating system. A few years ago, PVS-Studio has already checked the kernel source code. It coincided with the analyzer release on macOS. It's been a while since then. The new kernel source code has been released. A second check? Why not?

Read more →
Total votes 1: ↑1 and ↓0+1
Comments0

Example of How New Diagnostics Appear in PVS-Studio

Reading time4 min
Views575

PVS-Studio new C++ rule


Users sometimes ask how new diagnostics appear in the PVS-Studio static analyzer. We answer that we draw inspiration from a variety of sources: books, coding standards, our own mistakes, our users' emails, and others. Recently we came up with an interesting idea of a new diagnostic. Today we decided to tell the story of how it happened.

Read more →
Rating0
Comments0

Short-lived Music or MuseScore Code Analysis

Reading time11 min
Views777

Having only programming background, it is impossible to develop software in some areas. Take the difficulties of medical software development as an example. The same is with music software, which will be discussed in this article. Here you need an advice of subject matter experts. However, it's more expensive for software development. That is why developers sometimes save on code quality. The example of the MuseScore project check, described in the article, will show the importance of code quality expertise. Hopefully, programming and musical humor will brighten up the technical text.

Читать далее
Total votes 2: ↑1 and ↓10
Comments0

PVS-Studio, Blender: Series of Notes on Advantages of Regular Static Analysis of Code

Reading time5 min
Views470

PVS-Studio and Blender


In our articles, we regularly repeat an important idea: a static analyzer should be used regularly. This helps detect and cheaply fix many errors at the earliest stage. It looks nice in theory. As we know, actions still speak louder than words. Let's look at some recent bugs in new code of the Blender project.

Read more →
Rating0
Comments0

OOX 2.0: Out of order execution made easy

Reading time13 min
Views2K

As Intel Threading Building Blocks (TBB) is being refreshed using new C++ standard, deprecating tbb::task interface, the need for high-level tasking interface becomes more obvious. In this article, I’m proposing yet another way of defining what a high-level parallel task programming model can look like in modern C++. I created it in 2014 and it was my last contribution to TBB project as its core developer after 9 wonderful years of working there. However, this proposal has not been used in production yet, so a new discussion might help it to be adopted.

Read more
Total votes 10: ↑10 and ↓0+10
Comments0

Why PVS-Studio Uses Data Flow Analysis: Based on Gripping Error in Open Asset Import Library

Reading time5 min
Views660

Why PVS-Studio Uses Data Flow Analysis
An essential part of any modern static code analyzer is data flow analysis. However, from an outside perspective, the use of data flow analysis and its benefit is unclear. Some people still consider static analysis a tool searching for something in code according to a certain pattern. Thus, we occasionally write blog posts to show how this or that technology, used in the PVS-Studio analyzer, helps to identify another interesting error. Today, we have such an article about the bug found in the Base64, one of the encoding standard implementations of binary data.

Read more →
Total votes 2: ↑2 and ↓0+2
Comments0

Date Processing Attracts Bugs or 77 Defects in Qt 6

Reading time24 min
Views1.6K

PVS-Studio & Qt 6


The recent Qt 6 release compelled us to recheck the framework with PVS-Studio. In this article, we reviewed various interesting errors we found, for example, those related to processing dates. The errors we discovered prove that developers can greatly benefit from regularly checking their projects with tools like PVS-Studio.

Read more →
Total votes 1: ↑1 and ↓0+1
Comments0

Just for Fun: PVS-Studio Team Came Up With Monitoring Quality of Some Open Source Projects

Reading time5 min
Views1.1K

Static code analysis is a crucial component of all modern projects. Its proper application is even more important. We decided to set up a regular check of some open source projects to see the effect of the analyzer's frequent running. We use the PVS-Studio analyzer to check projects. As for viewing the outcome, the choice fell on SonarQube. As a result, our subscribers will learn about new interesting bugs in the newly written code. We hope you'll have fun.

Читать далее
Rating0
Comments1

How to Get Nice Error Reports Using SARIF in GitHub

Reading time7 min
Views1.5K

Let's say you use GitHub, write code, and do other fun stuff. You also use a static analyzer to enhance your work quality and optimize the timing. Once you come up with an idea - why not view the errors that the analyzer gave right in GitHub? Yeah, and also it would be great if it looked nice. So, what should you do? The answer is very simple. SARIF is right for you. This article will cover what SARIF is and how to set it up. Enjoy the reading!

Читать далее
Total votes 3: ↑3 and ↓0+3
Comments0

Authors' contribution