Mail Archives: djgpp/2001/02/01/12:18:27
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 -