August 2021

Intermodular analysis of C++ projects in PVS-Studio

Recently PVS-Studio has implemented a major feature—we supported intermodular analysis of C++ projects. This article covers our and other tools' implementations. You'll also find out how to try this feature and what we managed to detect using it.

Intermodular analysis of C++ projects in PVS-Studio

by Oleg Lisiy, Sergey Larin

From the article:

We can't apply the approach above to the PVS-Studio tool. Our analyzer's main difference from compilers is that it doesn't form intermediate representation that is abstracted from the language context. Therefore, to read a symbol from another module, the tool has to translate it again and represent a program as in-memory data structures (parse tree, control flow graph, etc). Data flow analysis may also require parsing the entire dependency graph by symbols in different modules. Such a task may take a long time. So, we collect information about symbols (in particular in data flow analysis) using semantic analysis. We need to somehow save this data separately beforehand. Such information is a set of facts for a particular symbol. We developed the below approach based on this idea.

CppCon 2019 The Dawn of a New Error--Phil Nash

Registration is now open for CppCon 2021, which starts on October 24 and will be held both in person and online. To whet your appetite for this year’s conference, we’re posting videos of some of the top-rated talks from our most recent in-person conference in 2019 and our online conference in 2020. Here’s another CppCon talk video we hope you will enjoy – and why not register today for CppCon 2021 to attend in person, online, or both!

The Dawn of a New Error

by Phil Nash

Summary of the talk:

As a community we've tried many different ways to express, propagate and handle error conditions in our code over the years. Each seem to have different trade-offs, with none being perfect in all cases.

This presentation is the follow-up to my earlier talk, "Option(al) Is Not a Failure", where I surveyed existing error-handling approaches and score them against each other, leading up to the new proposal, p0709, "Zero-overhead deterministic exceptions".

We'll summarise some of that background so we're all on the same page, but in this talk we're going to dig into the proposal in more depth - and look at the supporting proposals, p1028 (std::error) and p1029 ([[move relocates]]) and others. We'll also comment similar mechanisms in other languages, notably Swift, to get an idea of how it might work out in practice.

Counting in Iteration Models--Barry Revzin

What is your opinion?

Counting in Iteration Models

by Barry Revzin

From the article:

There’s a really interesting issue pointed out in the July 2021 mailing by way of P2406R0.

Basically, in C++, the iterator loop structure ordering is as follows (I wrote it with a goto to make the ordering more obvious. Note that in C++, we start with the it != end check, not the ++it operation. The point of this ordering is to focus on the transition from one position to the next)...

C++20 concepts are structural: What, why, and how to change it?--Jonathan Müller

Flexibility.

C++20 concepts are structural: What, why, and how to change it?

by Jonathan Müller

From the article:

C++20 added concepts as a language feature. They’re often compared to Haskell’s type classes, Rust’s traits or Swift’s protocols.

Yet there is one feature that sets them apart: types model C++ concepts automatically. In Haskell, you need an instance, in Rust, you need an impl, and in Swift, you need an extension. But in C++? In C++, concepts are just fancy boolean predicates that check for well-formed syntax: every type that makes the syntax well-formed passes the predicate and thus models the concepts.

This was the correct choice, but is sometimes not what you want. Let’s explore it further.

Voting results and the Top 10 talks for Meeting C++ 2021

The results from the voting for this years Meeting C++ conference are in, and published together with the Top10 of talks!

Voting results and the top 10 Talks for Meeting C++ 2021

by Jens Weller

From the article

The Meeting C++ hive mind has spoken, and given the feedback of the C++ community to the submissions of Meeting C++ 2021.

Like in the previous years, one could vote from 0-5 for each talk and leave a comment if you'd like on each talk. The talks are randomized in Order, and not every voting session has finished the full stack of talks to vote on. The result below is then achieved by weighing the votes from 0-5 as {-3,-2,-1,1,3,4}, this gives the talks that folks want to see a bit of an edge, while the negative numbers help to keep the range of the end result a bit closer. Having bought a ticket before the voting starts does give you a higher voting weight, as you'll be attending the conference.


 

CppCon update: Near-record number of talk submissions

hallway_track-300x188.jpegA near-record number of talk submissions, with the large majority of speakers asking to deliver their talks in person, on-site in Aurora this October:

Big Update with Big Thanks for a Big Program

by Jon Kalb

From the announcement:

The deadline for Main Program submissions has passed with a near-record number of submissions! ... We are excited both by the quality of the submissions and by the fact that that the vast majority of submissions were for onsite presentations.

... Our Program Committee is currently hard at work reviewing and rating each submission and we know that we’ll have an amazing program for both onsite and online attendees in Aurora in October. As you know, we’ve announced that Bjarne Stroustrup will be our opening keynote onsite... Creating multiple, thoughtful evaluations on almost two-hundred submissions touching on virtually every topic of C++ and software design in less than a month is a mammoth task, but we know that the CppCon 2021 Program that you’ll be seeing in Aurora and/or online, will be something that we as organizers, the Program Committee, and the presenters, will be proud to present.

Integrating PVS-Studio into uVision Keil

I've been using this scenario until one day I spent 3 days debugging a very unpleasant bug. The bug kept savagely appearing from time to time. It turned out to be a banal null pointer dereference. I quickly realized that PVS-Studio detects this bug. That was the final nail in the coffin of my patience! – and started integrating PVS-Studio into Keil.

Integrating PVS-Studio into uVision Keil

by Amomum

From the article:

Keil provides a weird feature – creating a project batch file. I still don't know the purpose of this feature. This batch file contains all the necessary information for PVS-Studio, and it's enabled with a single check mark! Unfortunately, this check mark also breaks the incremental build. That is, any compilation becomes a complete recompilation. It affects the build time, so, unfortunately, it's not an option for us.

C++ developers conference C++ Russia is looking for speakers

If you think that you have nothing to share with the audience, you might be wrong. Your professional experience could prove useful to colleagues from all over the world.

Call for papers for conference C++ Russia

by C++ Russia

About the call:

Feel free to share your ideas with us. We will help to prepare your performance.

Plus, as a speaker, you’ll get Full Pass, one ticket to all season’s conferences.

Call for papers is on up to the 13d September.

 

CppCon 2020 Test Driven C++--Phil Nash

Registration is now open for CppCon 2021, which starts on October 24 and will be held both in person and online. To whet your appetite for this year’s conference, we’re posting videos of some of the top-rated talks from our most recent in-person conference in 2019 and our online conference in 2020. Here’s another CppCon talk video we hope you will enjoy – and why not register today for CppCon 2021 to attend in person, online, or both!

Test Driven C++

by Phil Nash

Summary of the talk:

We know that testing is important, but writing tests is hard and takes time - and can be demotivating when you want to hack out features.

But what if we flipped the whole thing around? It turns out that by writing tests _first_ the dynamic changes in unexpected ways. Testing becomes easier. Adding features becomes easier. The dopamine hit you get from seeing something work becomes more frequent. Time lost to bugs and regressions virtually disappears. You start to get invited to bigger and better parties!

Ok, one of those statements is not guaranteed - but the rest are! If you've never tried TDD (perhaps you have heard of it but been skeptical), or maybe had a bad experience in the past, this talk will give you a sound intro to how it work, how you can get started, and what you can expect to achieve.

Shift-M/47: Bjarne Stroustrup on the future of programming--Yegor Bugayenko

The future is coming.

Shift-M/47: Bjarne Stroustrup on the future of programming

by Yegor Bugayenko

Summary of the video:

00:00 Introduction
00:58 How to make a language popular
06:24 Do we need committees to add new features to the language
13:05 Future of C++
14:54 NoCode
17:51 AI for optimizing of source code
23:28 Formal definition of language
28:05 Complexity of languages
41:18 Mistakes in C++
46:37 Future of programming languages
48:39 What was the purpose of creating C ++
56:59 Life goal