Date: Thu, 1 Feb 2001 13:16:00 +0200 (IST) From: Eli Zaretskii X-Sender: eliz AT is To: Eric Wajnberg 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: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII 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 Precedence: bulk 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.