Mail Archives: djgpp-workers/2001/06/10/08:30:50
On Sun, 10 Jun 2001, Tim Van Holder wrote:
> 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.
It's not wrong, it's very natural in C, if you think about a function
invocation as a kind of expression (which it is). All integral types
shorter than int are always promoted to int's in an expression.
> The warning is only useful when converting legacy C code
The DJGPP library has quite a lot of such legacy code, most of it going
back to the BSD library, originally used by DJ for v1.x. The timezone
code (djtzs*.zip) is also ``legacy code'', as well as edebug and fsdb.
> As you say, converting a function to varargs may trigger breakage, but how
> likely is that to happen?
I don't know. But it seems a good idea to pay such a small price for
added safety.
- Raw text -