delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp-workers/2001/06/11/07:39:32

X-Authentication-Warning: acp3bf.physik.rwth-aachen.de: broeker owned process doing -bs
Date: Mon, 11 Jun 2001 13:39:24 +0200 (MET DST)
From: Hans-Bernhard Broeker <broeker AT physik DOT rwth-aachen DOT de>
X-Sender: broeker AT acp3bf
To: djgpp-workers AT delorie DOT com
cc: ams AT ludd DOT luth DOT se
Subject: Re: Compiler options for djdev build
In-Reply-To: <1190-Sat09Jun2001231319+0300-eliz@is.elta.co.il>
Message-ID: <Pine.LNX.4.10.10106111332140.966-100000@acp3bf>
MIME-Version: 1.0
Reply-To: djgpp-workers AT delorie DOT com
Errors-To: nobody AT delorie DOT com
X-Mailing-List: djgpp-workers AT delorie DOT com
X-Unsubscribes-To: listserv AT delorie DOT com

On Sat, 9 Jun 2001, Eli Zaretskii wrote:

> > From: Martin Str|mberg <ams AT ludd DOT luth DOT se>
> > Date: Sat, 9 Jun 2001 19:26:07 +0200 (MEST)
> > 
> > What I'm saying is todigit() is declared before its use. todigit()
> > expects a char as its argument (in the original code). Ok?
> > 
> > Why is gcc complaining? 
> > 
> > Because we used the flag -Wconversion. 
> 
> GCC is complaining because we asked it to with -Wconversion.  I think
> -Wconversion is useful because it flags code that could break if small
> changes are introduced into the code.

Let's please not forget about one further fine detail: todigit, in the
case at hand, is a function of internal linkage (i.e. it's flagged
"static"), i.e. the function itself, the prototype, and its usage are all
in one and the same source file. 

We already have -Wimplicit active, so the compiler will not ever let us
remove the prototype completely. I'm not quite sure it would accept an
old-style declaration, either. If it doesn't, the only way we could
possibly cause constructs like this to break would be turning todigit()
into a varargs functions. Which definitely is not a small change, IMHO.

So: -Wconversion is not helping us to avoid any likely problem, but OTOH,
it's causing the need of promotion operations. Which don't come for free,
on our CPU types.  I second Martin's point of view, therefore: let's not
use -Wconversion.

-- 
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