Mail Archives: djgpp/2001/02/01/07:10:11
On 1 Feb 2001, Eric Wajnberg wrote:
> I am in need now for an utility program that can do an accurate check of the
> code before compiling it. Actually I need something like lint, wich is
> standard in all UNIX OS.
I suggest GCC.
> I mean something that can - of course - identify
> syntax problems and wrong declarations, but also all weird things like
> declaration of parameters/functions not used in the remaining part of the
> code, or global parameters than could be local, etc..
>
> The use of -Wall is helpfull, but - as long as I've seen - it does not
> generate warnings if a parameter/function is declared and unused, etc.
The -Wall switch is not the final word in GCC's treasure trove of
warnings and useful diagnostics. First, add -W, then look up more
-Wsomething options in the GCC manual which aren't part of -W and -Wall,
and then add -O, since some of the flow analysis, like the one needed to
find unused variables and parameters, is not done by GCC unless it is
optimizing.
FWIW, I never needed lint since I started using GCC.
- Raw text -