delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/2001/02/01/12:18:27

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 <broeker AT physik DOT rwth-aachen DOT de>
X-Sender: broeker AT acp3bf
To: Eli Zaretskii <eliz AT is DOT elta DOT co DOT il>
cc: djgpp AT delorie DOT com
Subject: Re: DJGPP and lint-like utility
In-Reply-To: <Pine.SUN.3.91.1010201184924.17516H-100000@is>
Message-ID: <Pine.LNX.4.10.10102011806140.879-100000@acp3bf>
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 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.

- Raw text -


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