Originally published on my personal website.
If you've ever worked in a C codebase, you've probably been frustrated with the lack of tooling that is available to you, especially compared to more modern languages like TypeScript. The truth is, C does have capable tooling support, but they aren't as well-known as other tools are, and most don't come automatically out of the box. This article aims to show you how to set up three C tools to improve code quality and your editor experience: clangd, clang-tidy, and cppcheck.
Why use these tools?
Before explaining why to use these tools, it's important to explain what they are. clang-tidy and cppcheck are static analyzers, meaning they check your code for bugs before they happen and suggest how to make your code cleaner through formatting and style suggestions. clang-tidy focuses on linting (performing style checks) and bug-finding, while cppcheck mainly focuses on bug-finding.
clangd is a language server tool that acts as an Intellisense provider, allowing for autocomplete, hover information, and error information. One of the most helpful features of clangd is its ability to highlight warnings found by clang-tidy, so you can see them in your IDE while developing.








