Paul Eggert <[EMAIL PROTECTED]> writes:
> When building wget 1.6 on Solaris 2.5.1 with GCC 2.95.3, I ran
> into the following porting problem.
>
> snprintf.c: In function `dopr':
[ for isdigit(char) ]
> snprintf.c:230: warning: subscript has type `char'
> snprintf.c:254: warning: subscript has type `char'
This is sounds like a Solaris problem to me. :-) I'm kidding.
Actually, the problem is that the is* macros apparently accpet "int"
arguments, so the default conversion from signed char is not what you
usually want.
To get around this, Wget uses its own set of IS* macros, where
e.g. ISDIGIT(c) expands to isdigit((unsigned char)c), which is what
you want. This is not used in snprintf.c because that file is
maintained separately from Wget, and I want syncs to be easy.
Since this instance of isdigit is always used on format strings, which
are constants in source, there is no danger of passing an actual >=128
character that would cause real problems. The warnings I can live
with.