Review. Report. Fix.
Clang-based MISRA C++:2023 static analysis for C and C++ code. THEMIS Lint reads your compilation database, flags risky constructs against the guidelines, reports in text, JSON, HTML or SARIF, and can correct many findings automatically.
Most C++ faults are quiet: the code compiles, passes a quick test and misbehaves later. Finding uninitialised variables, narrowing conversions, missing override and discarded error results at build time is far cheaper than finding them in service.
What it checks
THEMIS Lint reads your compile_commands.json and analyzes each translation unit with Clang's AST, preprocessor and control-flow analysis. Every finding is mapped to a MISRA C++:2023 guideline number and category.
| Category | Meaning | Guidelines with a rule |
|---|---|---|
| Mandatory | Must always be complied with | 5 of 5 |
| Required | Compliant unless a formal deviation is raised | 123 of 124 |
| Advisory | Recommended good practice | 50 of 50 |
In total, 178 of the 179 catalogued guidelines have an implemented rule. The rule mapping is a project-local model that has not been independently signed off, so treat findings as signals for review.
Reports and integration
One analysis run can produce several outputs side by side:
- Plain text for the terminal, with a compact
--summarymode - JSON as the full compliance record, including a traceability matrix of every guideline
- HTML as a self-contained review report with coverage badges, category breakdowns and the full findings list
- SARIF 2.1.0 for IDEs, GitHub code scanning and CI systems, with MISRA category mapped to SARIF level, stable per-finding fingerprints and justified deviations kept as in-source suppressions
- Trend dashboard that aggregates a folder of dated JSON reports into a single page
THEMIS Lint runs from a CMake build as a custom target. It exits with status 0 even when violations are found, so a CI gate reads the report rather than the exit code.
Automatic fixes
Run with --fix and THEMIS Lint rewrites the sources for 23 rules that have a safe, mechanical correction. Typical fixes include:
- Braces added around bare
if,else, loop andswitchbodies NULLand0replaced withnullptrintandunsigned longreplaced with fixed-widthstd::intN_ttypes- Missing
overrideanddefault:labels added - Implicit narrowing and arithmetic conversions made explicit with
static_cast - Uninitialised variables and members given
{}initialisers - C-style casts replaced with the C++ cast the compiler actually performs
Every fix is announced on standard output with the rule and position. Fixes are never applied to a translation unit that Clang reported errors for, and an edit is refused if the file changed since analysis. Rules with no safe rewrite, such as dynamic memory use, are reported but never changed. Preview with a normal run first and use a clean working tree.
Reviewed deviations
Real, reviewed exceptions are recorded inline with a misra-suppress(...) comment that carries a written justification. Suppressed findings are not hidden: they appear in the JSON, HTML and SARIF reports as overridden, together with their justification, so the audit trail stays visible.
Focus the analysis
--componentlimits a run to files whose path matches--excludeskips generated and vendored code--rulesrestricts a run to selected rule IDs--jobsruns the analysis in parallel--list-rulesprints the guideline catalog as JSON--title,--versionand--githashstamp the report metadata
A Qt desktop application, themis-lint-gui, is also built from the same repository for reviewing findings alongside the source.
Platforms and installation
THEMIS Lint is built with CMake against Clang/LLVM and Qt6 Core, and is continuously built on Ubuntu 24.04, Ubuntu 26.04, AlmaLinux 9 and AlmaLinux 10. It installs with a man page and can be packaged as DEB or RPM.
What it is not
THEMIS Lint is a practical review aid. It is not a formally certified MISRA tool and does not claim full coverage of every guideline. For a formal MISRA compliance claim, use a recognized MISRA tooling vendor and a formal review process.
The MISRA guideline text is a licensed publication available from misra.org.uk. THEMIS Lint does not reproduce it.