Mail Archives: djgpp-workers/2001/06/11/07:39:32
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 -