lint (software)

From Wikipedia, the free encyclopedia
Jump to: navigation, search

A linter or lint refers to tools that analyze source code to flag programming errors, bugs, stylistic errors, and suspicious constructs.[1] The term is originated from a Unix utility that examined C language source code.[2]


Stephen C. Johnson, a computer scientist at Bell Labs, came up with lint in 1978 while debugging the Yacc grammar he was writing for C and dealing with portability issues stemming from porting Unix to a 32-bit machine.[3][2] The term "lint" was derived from the name of the undesirable bits of fiber and fluff found in sheep's wool.[citation needed] In 1979, lint was used outside of Bell Labs for the first time in the seventh version (V7) of the Unix operating system.

Over the years, different versions of lint were developed for many C and C++ compilers and while modern-day compilers have lint-like functions, lint-like tools have also advanced their capabilities. For example, Gimpel's PC-Lint, used to analyze C++ source code, is still being sold even though it was introduced in 1985.[3]


The analysis performed by lint-like tools are also performed by optimizing compilers, whose goal is to generate faster code. Johnson, in his original 1978 paper, addressed this issue, concluding that "the general notion of having two programs is a good one" because they concentrate on different things, thereby allowing the programmer to "concentrate at one stage of the programming process solely on the algorithms, data structures, and correctness of the program, and then later retrofit, with the aid of lint, the desirable properties of universality and portability".[2]

Even though modern compilers have evolved to detect many of lint's historical responsibilities, lint-like tools have also evolved to be able to detect a wider variety of suspicious constructs that are beyond the typical abilities of optimizing compilers. These include "warnings about syntax errors, uses of undeclared variables, calls to deprecated functions, spacing and formatting conventions, misuse of scope, implicit fallthrough in switch statements, missing license headers, [and]...dangerous language features".[4]

Specifically, lint-like tools are especially useful for interpreted languages like JavaScript and Python. Because such languages lack a compiling phase that displays a list of errors prior to execution, they can also be used as simple debuggers for common errors (showing syntactic discrepancies as errors) as well as hard-to-find errors such as heisenbugs (drawing attention on suspicious code as "possible errors").[citation needed] Lint-like tools generally perform static analysis of source code.[5]

See also[edit]


  1. ^ "About SublimeLinter — SublimeLinter 3.4.24 documentation". 
  2. ^ a b c Johnson, Stephen C. (25 October 1978). "Lint, a C Program Checker". pp. 78–1273 – via CiteSeer. 
  3. ^ a b Morris, Richard (1 October 2009). "Stephen Curtis Johnson: Geek of the Week". Red Gate Software. Retrieved 19 January 2018. 
  4. ^ "Arcanist User Guide: Lint". Phabricator. Retrieved 19 January 2018. 
  5. ^ Jones, Nigel (1 May 2002). "How to Use Lint for Static Code Analysis". Barr Group. 

Further reading[edit]