Pull to refresh
267

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

The Drawbacks of Using std::vector as an Output Buffer in I/O Operations

Level of difficulty Medium
Reading time 7 min
Views 1.5K
C++ *
Case

In this short article, we will examine some non-obvious performance issues that can arise when using std::vector<char> as an output buffer for input-output operations. Specifically, we will discuss the consequences of using the resize and reserve methods and how their improper use can lead to undesirable outcomes.

Read more
Total votes 13: ↑2 and ↓11 -9
Comments 45

Technical Note. From C++1998 to C++2020

Reading time 1 min
Views 1.4K
C++ *

This technical note is devoted to covering information regarding all primary C++ programming language standards: C++03/98/11/14/17/20.

I am glad to share a technical note with some details regarding the C and all primary C++ programming language standards based on my experience and materials from the Reference Section of this document.

As of August 15, 2022, this technical note in PDF format consists of 72 pages.

Read more
Total votes 6: ↑2 and ↓4 -2
Comments 2

Electron + web camera (cpp-ffmpeg)

Reading time 8 min
Views 2K
C++ *Development for MacOS *ReactJS *
Recovery mode
Sandbox

An example of using Electron + React JS and a native ffmpeg addon to access a webcamera

This guide may be helpful to someone who is trying to find a way
to work with Electron if they need to use a c++ library or code

I was looking for a more realistic example than a simple 'hello world' and i didn't succeed

Here are the links in advance:

- electron - https://github.com/khomin/electron_camera_ffmpeg

- addon - https://github.com/khomin/electron_ffmpeg_addon_camera

So let me share my experience...

Read more
Total votes 3: ↑3 and ↓0 +3
Comments 0

How PVS-Studio prevents rash code changes, example N4

Reading time 2 min
Views 814
PVS-Studio corporate blog C++ *Development Management *

Blender, PVS-Studio, std::clamp
If you regularly use a static code analyzer, you can save time on guessing why the new code doesn't work as planned. Let's look at another interesting error — the function broke during refactoring, and no one noticed that. No one — except for PVS-Studio that can automatically scan the project and email the report to us.

Read more →
Total votes 2: ↑1 and ↓1 0
Comments 0

PVS-Studio checks the code of Flipper Zero dolphin

Reading time 12 min
Views 1.2K
PVS-Studio corporate blog Open source *C++ *C *Programming microcontrollers *

Flipper Zero + PVS-Studio


Flipper Zero is an open-source multi-tool for geeks and penetration testers. It so happened that the Flipper Zero project and the PVS-Studio analyzer crossed paths. A philosophical question: should we check the project, if the project developers have already started fixing errors? Let's try to do this.

Read more →
Total votes 6: ↑5 and ↓1 +4
Comments 0

Even small projects have bugs, or how PVS-Studio checked Blend2D

Reading time 11 min
Views 677
PVS-Studio corporate blog Open source *C++ *C *

We often check large projects because it's easier to find bugs there. What if we try PVS-Studio on a small project? In this article we analyze Blend2D — a library for vector 2D graphics. Let's look at what we found.


0894_Blend2d/image1.png


Introduction


It's no secret that large projects have fascinating errors. It's not just "the larger the codebase is – the more errors we can find". It's also a known fact that the density of errors grows along with the codebase. That's why we love checking large projects — to treat you with a variety of "yummy" and tricky errors and typos. Besides, it's always interesting to search through a huge project with lots of dependencies, legacy code, and other stuff.


Today I'm moving away from this tradition. I decided to take a small project and see what PVS-Studio can find there. I chose Blend2D — branch master, commit c484790.

Read more →
Total votes 3: ↑2 and ↓1 +1
Comments 0

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

Reading time 6 min
Views 2.6K
PVS-Studio corporate blog Programming *C++ *

Virtual function calls in constructors (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.

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

Thanks, Mario, but the code needs fixing — checking TheXTech

Reading time 12 min
Views 792
PVS-Studio corporate blog Open source *C++ *Game development *

It's cool when enthusiastic developers create a working clone of a famous game. It's even cooler when people are ready to continue the development of such projects! In this article, we check TheXTech with PVS-Studio. TheXTech is an open implementation of the game from the Super Mario universe.


0889_TheXTech/image1.png

Read more →
Total votes 3: ↑3 and ↓0 +3
Comments 0

How the Carla car simulator helped us level up the static analysis of Unreal Engine 4 projects

Reading time 17 min
Views 1K
PVS-Studio corporate blog Programming *C++ *Game development *Unreal Engine *

One of the mechanisms of static analysis is method annotations of popular libraries. Annotations provide more information about functions during errors detecting. CARLA is an impressive open-source project in C++ that helped us implement this mechanism to our analyzer. Subsequently, the simulator became a test-target for the improved PVS-Studio static analyzer.


0888_Carla/image2.png

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

Authors' contribution