delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/2001/02/01/07:10:11

Date: Thu, 1 Feb 2001 13:16:00 +0200 (IST)
From: Eli Zaretskii <eliz AT is DOT elta DOT co DOT il>
X-Sender: eliz AT is
To: Eric Wajnberg <wajnberg AT antibes DOT inra DOT fr>
cc: djgpp AT delorie DOT com
Subject: Re: DJGPP and lint-like utility
In-Reply-To: <95bbfn$qbp$1@saphir.jouy.inra.fr>
Message-ID: <Pine.SUN.3.91.1010201131217.15009B-100000@is>
MIME-Version: 1.0
Reply-To: djgpp AT delorie DOT com
Errors-To: nobody AT delorie DOT com
X-Mailing-List: djgpp AT delorie DOT com
X-Unsubscribes-To: listserv AT delorie DOT com

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 -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019