lint (software)

From Wikipedia, the free encyclopedia
  (Redirected from Lint programming tool)
Jump to: navigation, search

In computer programming, lint is a Unix utility that flags some suspicious and non-portable constructs (likely to be bugs) in C language source code.[1][2] Generically, lint or a linter is any tool that detects and flags errors in programming languages, including stylistic errors.[3] The term lint-like behavior is sometimes applied to the process of flagging suspicious language usage. Lint-like tools generally perform static analysis of source code.

Lint as a term can also refer more broadly to syntactic discrepancies in general, especially in interpreted languages like JavaScript and Python. For example, modern lint checkers are often used to find code that does not correspond to certain style guidelines. Because these languages lack a compiling phase that shows a list of errors prior to execution, they can also be used as simple debuggers for common errors (showing syntactic discrepancies as errors) or hard to find errors such as heisenbugs (drawing attention on suspicious code as "possible errors").


Lint first appeared (outside of Bell Labs) in the seventh version (V7) of the Unix operating system in 1979. It was derived from PCC, the Portable C Compiler. Lint and PCC were developed by Stephen C. Johnson, who also authored the parser generator yacc.

The term was derived from the name of the undesirable bits of fiber and fluff found in sheep's wool.[citation needed]


Suspicious constructs include: variables being used before being set, division by zero, conditions that are constant, and calculations whose result is likely to be outside the range of values representable in the type used.[1]

Many of the forms of analysis performed by lint-like tools are also performed by optimizing compilers, whose prime motivation is to generate faster code. Modern compilers can often detect many of the constructs traditionally warned about by lint.

Writers of lint-like tools have continued to improve the range of suspicious constructs that they detect. Modern tools perform forms of analysis that many optimizing compilers typically do not do, such as cross-module consistency checking, checking that the code will be portable to other compilers, and supporting annotations that specify intended behavior or properties of code.[citation needed]

See also[edit]


  1. ^ a b Johnson, S. C. (25 October 1978). "Lint, a C Program Checker". pp. 78–1273 – via CiteSeer. 
  2. ^ "How to Use Lint for Static Code Analysis". 1 May 2002. 
  3. ^ "About SublimeLinter — SublimeLinter 3.4.24 documentation". 

Further reading[edit]

External links[edit]