In short
Linting is automated analysis of source code that detects likely errors, unsafe constructs and coding-standard violations without executing the program. It flags code that compiles cleanly but is probably wrong: uninitialised variables, type mismatches, unreachable code, and violations of a coding standard such as MISRA C. The term comes from lint, written by Stephen Johnson at Bell Labs in 1978 for C.
What Is Linting?
Linting is automated analysis of source code that detects likely errors, unsafe constructs and coding-standard violations without executing the program. A linter reads your source, applies a rule set, and reports constructs that are legal in the language but probably wrong: uninitialised variables, type mismatches, unreachable code, implicit conversions that silently lose precision.
The term originates from lint, a tool written by Stephen Johnson at Bell Labs in 1978 for the C programming language. Johnson’s lint flagged constructs that were technically valid C but likely to be bugs, and the name became the generic term for the entire category.
If you have ever pushed code only to have a colleague point out an uninitialised variable or a missing null check during review, you have encountered exactly the kind of problem linting is designed to catch, automatically, before anyone else sees your code.
What Is Lint in Programming?
In programming, “lint” means a static analysis tool that inspects source code without running it. It has nothing to do with the everyday sense of lint as fabric fluff, and the two meanings simply share a name: Johnson chose it because the tool picks small, unwanted bits out of otherwise finished work.
Every major language now has at least one linter: ESLint for JavaScript, Pylint for Python, PC-Lint for C/C++, and many others. At its simplest, a linter applies pattern-matching rules to your source code and reports violations.
Here is the kind of defect a linter is built to find. This function compiles without a single error:
int read_sensor_scaled(const uint8_t *frame, size_t len)
{
int raw; /* never initialised */
if (len >= 2U) {
raw = (frame[0] << 8) | frame[1];
}
return raw / frame[2]; /* uninitialised read when len < 2,
out-of-bounds read when len < 3,
division by zero when frame[2] == 0 */
}
Three distinct defects, all legal C, none of them guaranteed to be reported by a default compiler invocation. A linter flags the uninitialised read on the path where len < 2. A full static analyser goes further and proves the out-of-bounds access and the potential division by zero by tracking how len and frame flow into the function from every call site.
Linting, Compiler Warnings and Static Analysis
The three are often used interchangeably and should not be. They are layers, and each one catches what the layer below it cannot.
| Layer | What it analyses | Typical findings | Coding-standard enforcement | Compliance evidence |
|---|---|---|---|---|
| Compiler warnings | The translation unit being compiled, as a by-product of code generation | Unused variables, obvious type mismatches, some format-string errors | None | None |
| Linting | Source text and syntax, usually one file at a time, against a configurable rule set | Suspicious constructs, style and naming violations, simple unreachable code | Partial, rule-by-rule | Not traceable |
| Static analysis | Whole-program data flow and control flow across functions and translation units | Null pointer dereference, use-after-free, uninitialised reads, buffer overruns, taint from untrusted input | Full rule sets such as MISRA C, MISRA C++, AUTOSAR C++14, CERT C | Compliance reports and documented deviation records |
The distinction matters most in embedded work, because the third row is the only one a functional safety assessor will accept as evidence.
Basic Linting vs. Advanced Static Analysis
For web application teams, a basic linter is often sufficient. Catching a missing semicolon or an unused import is valuable, but the consequences of missing such issues are rarely catastrophic.
Embedded C/C++ teams operate in a fundamentally different world. The code they write controls braking systems, medical infusion pumps, industrial robots, and aircraft flight controllers. A buffer overflow is not a crash report in a dashboard, it is a potential safety incident.
This is where basic linting reaches its limits. Pattern-matching rules can catch surface-level issues, but they cannot reason about how data flows through a program across function boundaries, translation units, and complex pointer operations. They cannot determine whether a particular execution path leads to a division by zero three function calls deep.
Basic linters like PC-Lint and Splint offer:
- Syntactic pattern matching
- Type-checking beyond what the compiler provides
- Simple unreachable code detection
- Style and naming convention enforcement
Advanced static analysers like Helix QAC and Klocwork go significantly further:
- Data-flow analysis: Tracking variable values across function calls, files, and translation units to detect null pointer dereferences, use-after-free, and uninitialised reads
- Control-flow analysis: Mapping every possible execution path to find dead code, infinite loops, and race conditions
- Complexity metrics: Quantifying cyclomatic complexity, nesting depth, and other maintainability indicators that predict defect density
- Coding standard enforcement: MISRA C (2004, 2012 with all amendments, 2023 and 2025), MISRA C++ (2008 and 2023), AUTOSAR C++14, and CERT C/C++ rule coverage, with deviation workflows rather than a bare pass/fail count
- Taint analysis: Tracing untrusted input through the program to identify security vulnerabilities (CWE top 25)
Why Embedded C/C++ Teams Need More Than a Basic Linter
Indian embedded teams, whether working on automotive ECUs, telecom base stations, or industrial automation controllers, face a specific set of pressures that make advanced static analysis essential.
| Pressure | What it means in practice | Why a basic linter is not enough |
|---|---|---|
| Regulatory compliance | ISO 26262 (automotive), IEC 62304 (medical device software) and DO-178C (airborne systems) all expect static analysis and enforcement of a coding standard such as MISRA | A basic linter produces findings, not evidence. Certification needs traceable compliance reports and documented deviation records, which is why teams use a tool qualified for the standard: Perforce states Helix QAC is TÜV SÜD certified for ISO 26262 up to ASIL D and IEC 61508 up to SIL 4 |
| Defect cost curve | A defect found while the developer is still in the file is cheaper to fix than the same defect found in integration, and far cheaper than a field recall | Pattern matching within one file cannot reach the interprocedural defects that survive both linting and peer review |
| Legacy codebases | Large C codebases that were never designed for unit testing still have to be assessed | Static analysis needs no test harness, so it is often the only way to get a complete risk picture of legacy firmware |
How GSAS Brings Enterprise Static Analysis to Indian Teams
GSAS MicroSystems provides Indian engineering organisations with two complementary static analysis platforms from Perforce:
Klocwork is designed for large-scale, multi-language environments. It supports C, C++, C#, Java, JavaScript, Python, and Kotlin. Its differential analysis engine integrates into CI/CD pipelines and scans only the code changed on each commit, which is what makes per-commit analysis practical on a large codebase. For teams adopting DevSecOps practices, Klocwork’s AI-assisted remediation guidance helps developers fix issues without waiting for a static analysis specialist.
Helix QAC is built for embedded C and C++ compliance work. Perforce lists coverage for MISRA C:2004, MISRA C:2012 with all amendments, MISRA C:2023, MISRA C:2025, MISRA C++:2008 and MISRA C++:2023, and states that QAC is TÜV SÜD certified for ISO 26262 up to ASIL D and IEC 61508 up to SIL 4. For teams working under those standards, that certification is what turns analysis output into qualification evidence a certification body will accept.
Source: Perforce Helix QAC, Perforce Software.
Both tools integrate with popular embedded IDEs, build systems, and version control, fitting into the workflows Indian teams already use.
Want to see what advanced static analysis finds in your codebase? Request a Klocwork evaluation from GSAS MicroSystems and we will run it against a representative portion of your own code.
Also appears in:
Interested in Perforce tools?
Talk to our application engineers for personalized tool recommendations.
More from Perforce
View all →