Somehow, we’ve happened to check most of the libraries making up a collection called “Awesome hpp”. These are small header-only projects in C++. Hopefully, the information about the bugs we’ve found will help make the libraries better. We’ll also be happy to see the developers use PVS-Studio on a regular basis thanks to the free-license option we provide.

https://import.viva64.com/docx/blog/0770_check_awesome_hpp/image1.png

What follows is an overview of bugs found in the different libraries on the curated list of awesome header-only C++ libraries: awesome-hpp.

I learned about this list from the “Cross Platform Mobile Telephony” podcast. While we’re at it, I recommend that all C++ programmers check out CppCast. It is the first podcast for C++ developers by C++ developers!

Despite the large number of projects making up the list, bugs were few. There are three reasons for that:

  • The projects are tiny. Many literally consist of just a header file.
  • We decided to skip some of the projects as they were too troublesome to compile.
  • Often, you can’t figure out whether template classes/functions have bugs in them until you have them instantiated. Consequently, many of the bugs can be detected only in a real project that makes an active use of a library. As for our analysis method, we simply included the headers into an empty .cpp file and ran the check, which drastically limited its effectiveness.

Even so, we’ve gathered enough warnings to write the article you are reading right now and a couple of additional ones.

A note for my teammates :). When I do something, I like to set and achieve a number of goals at once, and I urge you to follow my example. After learning about the awesome-hpp collection, I managed to accomplish the following useful tasks:

#cpp #c++

Checking a Header-Only C++ Library Collection (awesome-hpp)
1.10 GEEK