Customising clang tidy to modernise your legacy C++ code
summary
Custom clang‑tidy checks convert legacy printf wrappers to fmt::printf then fmt::print and prepare for C++23 std::print, changing about 7,500 lines across ~440 files. Work includes a modernize-use-std-print converter, tests (~1,500 lines of lit tests), handling format quirks (width/precision, integer/sign casts), fixing a valgrind-only crash with git bisect, and landing changes upstream so the checks run as part of clang‑tidy and automate safe bulk rewrites.
AI-written summary · about
chapters (9)
- 0:00Modernizing legacy C++
- 10:58What is Clang Tidy
- 15:11Extending Clang Tidy
- 21:52Testing custom checks
- 27:43printf to C++20 format
- 35:28Other printf-like functions
- 39:32Limitations and future
- 41:20Contributing to Clang Tidy
- 43:28Q&A
related talks
01h 05mImprove your code with Clang Tooling
01h 24mExtending clang-tidy in the Present and in the Future
56mHow to Refactor Millions of Line of Code Without Alienating Colleagues
01h 01mBetter Tools in Your Clang Toolbox
47mAdventures with C++ Legacy Codebases: Tales of Incremental Improvement
52m“Tools from the C++ eco-system to save a leg”
01h 01mTools from the C++ Ecosystem to save a leg
59mMechanical C++ Refactoring in the Present and in the Future
