Mail Archives: djgpp-workers/2001/06/10/06:48:28
> > IMHO, the annoyance of getting this kind of warning far outweighs the
> > usefulness of getting 'x = -1' (where x is unsigned) flagged (the only
> > other effect of -Wconversion).
>
> Unlike other warnings, this one is so easy to fix that I wouldn't call it
> annoyance.
Well, in order to "fix" this, you change the type used - i.e. you make
todigit() and friends take an int, not a char. But you're not passing an
integer value, you're actually passing a character value - as such,
declaring
the argument as int seems wrong. Other standard functions take ints where
you would expect chars, but that is because prototypes originally weren't
required; we require prototypes, so it is not an issue for us.
> For such a low price, I fail to see why is this flag met with such a
> staunch opposition. Are you saying that it is useless in general, and
> that GCC maintainers should have never added it?
I don't consider this a 'low price', I consider it a kludge. The warning is
only useful when converting legacy C code, so that you know that a prototype
you added had a potentially undesirable effect.
As you say, converting a function to varargs may trigger breakage, but how
likely is that to happen?
- Raw text -