X-Authentication-Warning: acp3bf.physik.rwth-aachen.de: broeker owned process doing -bs Date: Thu, 1 Feb 2001 18:13:04 +0100 (MET) From: Hans-Bernhard Broeker X-Sender: broeker AT acp3bf To: Eli Zaretskii cc: djgpp AT delorie DOT com Subject: Re: DJGPP and lint-like utility In-Reply-To: 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 Thu, 1 Feb 2001, Eli Zaretskii wrote: > > On 1 Feb 2001, Hans-Bernhard Broeker wrote: > > > If you want a 'lint' emulation, you need a whole slew of further > > options to GCC. Here's my personal favourite at this moment: > > > > CFLAGS='-g -Wall -O2 \ > > -Dgets=DONT_USE_GETS -Dscanf=DONT_USE_SCANF -Dlint -Wtraditional -Wshadow \ > > -Wpointer-arith -Wnested-externs -Winline -W -Wstrict-prototypes \ > > -Wmissing-prototypes -Wmissing-declarations' > > And add -Werror for a good measure ;-) I'd rather not. With this combination of -W flags, it's *extremely* hard to get by without a single warning. Adding -Werror, here, would over-do it. We do want warnings, sure, but with so many of them active, it'd be almost impossible to get any real source code through the compiler if you turned on -Werror, too. For that, there are just too many situations where GCC, despite all good effort, can't detect whether a given sequence of statements is correct or not. You can often modify the code to avoid that, but that will often come at a runtime cost. E.g. to fix an incorrectly detected -Wuninitialized warning, you usually have to add an initialization, which will not be optimized away, so it slows down execution a bit. -- Hans-Bernhard Broeker (broeker AT physik DOT rwth-aachen DOT de) Even if all the snow were burnt, ashes would remain.