Lint programming tool
Encyclopedia
In computer programming
Computer programming
Computer programming is the process of designing, writing, testing, debugging, and maintaining the source code of computer programs. This source code is written in one or more programming languages. The purpose of programming is to create a program that performs specific operations or exhibits a...

, lint was the name originally given to a particular program that flagged some suspicious and non-portable constructs (likely to be bugs) in C language
C (programming language)
C is a general-purpose computer programming language developed between 1969 and 1973 by Dennis Ritchie at the Bell Telephone Laboratories for use with the Unix operating system....

 source code
Source code
In computer science, source code is text written using the format and syntax of the programming language that it is being written in. Such a language is specially designed to facilitate the work of computer programmers, who specify the actions to be performed by a computer mostly by writing source...

. The term is now applied generically to tools that flag suspicious usage in software written in any computer language. The term lint-like behavior is sometimes applied to the process of flagging suspicious language usage. Lint-like tools generally perform static analysis
Static code analysis
Static program analysis is the analysis of computer software that is performed without actually executing programs built from that software In most cases the analysis is performed on some version of the source code and in the other cases some form of the object code...

 of source code.

Background

Lint first appeared (outside of Bell Labs
Bell Labs
Bell Laboratories is the research and development subsidiary of the French-owned Alcatel-Lucent and previously of the American Telephone & Telegraph Company , half-owned through its Western Electric manufacturing subsidiary.Bell Laboratories operates its...

) in the seventh version (V7) of the Unix
Unix
Unix is a multitasking, multi-user computer operating system originally developed in 1969 by a group of AT&T employees at Bell Labs, including Ken Thompson, Dennis Ritchie, Brian Kernighan, Douglas McIlroy, and Joe Ossanna...

 operating system in 1979. It was derived from PCC, the Portable C Compiler
Portable C Compiler
The Portable C Compiler is an early compiler for the C programming language written by Stephen C...

, which was included with that system. Lint and PCC were developed by Stephen C. Johnson
Stephen C. Johnson
Stephen Curtis Johnson spent nearly 20 years at Bell Labs and AT&T where he wrote yacc, lint, spell and the Portable C Compiler machine .Johnson earned his PhD in mathematics but has spent his entire career in computer science...

, who also authored the parser generator yacc
Yacc
The computer program yacc is a parser generator developed by Stephen C. Johnson at AT&T for the Unix operating system. The name is an acronym for "Yet Another Compiler Compiler." It generates a parser based on an analytic grammar written in a notation similar to BNF.Yacc used to be available as...

.

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

Overview

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

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 compiler
Compiler
A compiler is a computer program that transforms source code written in a programming language into another computer language...

s 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 don't 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.

External links

  • Man page: http://www.manpages.unixforum.co.uk/man-pages/unix/freebsd-6.2/1/lint-man-page.html
The source of this article is wikipedia, the free encyclopedia.  The text of this article is licensed under the GFDL.
 
x
OK