10

Does Ubuntu have a lint utility? How is it installed?

In computer programming, lint is a Unix utility..

https://en.wikipedia.org/wiki/Lint_%28software%29

thufir@mordor:~$ 
thufir@mordor:~$ gcc program.c -o prog
program.c:5:1: warning: return type defaults to ‘int’ [-Wimplicit-int]
 main()
 ^
thufir@mordor:~$ 
thufir@mordor:~$ ./prog

Hello World

thufir@mordor:~$ 
thufir@mordor:~$ lint program.c
No command 'lint' found, did you mean:
 Command 'line' from package 'util-linux' (main)
 Command 'jlint' from package 'jlint' (universe)
 Command 'link' from package 'coreutils' (main)
 Command 'dlint' from package 'dlint' (universe)
 Command 'lift' from package 'lift' (universe)
 Command 'tint' from package 'tint' (universe)
 Command 'hlint' from package 'hlint' (universe)
lint: command not found
thufir@mordor:~$ 

I'm trying to use lint as so:

lint program.c | tee program.lint

This displays the standard output of the command lint program.c at the computer, and at the same time saves a copy of it in the file program.lint. If a file named program.lint already exists, it is deleted and replaced.

https://en.wikipedia.org/wiki/Tee_%28command%29#Unix-like_2

The manpage which wikipedia references is for BSD, I can't find a manpage for the Linux variant. Do I need to install it, perhaps?

1

2 Answers 2

16

See splint - a GPL rewrite of lint.

However, splint does not fully support C99.

It is recommended to use cppcheck.

8

From apt-cache search lint

splint - tool for statically checking C programs for bugs.
splint-data - tool for statically checking C programs for bugs - data files
splint-doc-html - tool for statically checking C programs for bugs - HTML documentation

Installation

sudo apt-get install splint

Documentation

For documentation, examples and the downloads, check their website at http://www.splint.org.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .