Using static checkers
Static program analysis involves examining source code without running the compiled version. Consistently using static checkers can significantly improve code quality by making it more consistent and less susceptible to bugs and known security vulnerabilities. The C++ community offers a wide range of static checkers like Astrée
, clang-tidy
, CLazy
, CMetrics
, Cppcheck
, Cpplint
, CQMetrics
, ESBMC
, FlawFinder
, Flint
, IKOS
, Joern
, PC-Lint
, Scan-Build
, Vera++
, and more.
Many of these tools recognize CMake
as an industry standard and offer ready-to-use support or integration tutorials. Some build engineers prefer not to write CMake
code and instead include static checkers through external modules available online. An example is the collection by Lars Bilke on his GitHub repository: https://github.com/bilke/cmake-modules.
A common belief is that setting up static checkers is complicated. This perception exists because static checkers often emulate the behavior...