wget 1.6 porting problem with snprintf and isdigit on Solaris 2.5.1

2001-04-08 Thread Paul Eggert
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': snprintf.c:230: warning: subscript has type `char' snprintf.c:254: warning: subscript has type `char' This is warning that isdigit doesn't work on negative

Re: wget 1.6 porting problem with snprintf and isdigit on Solaris 2.5.1

2001-04-08 Thread Jan Prikryl
Quoting Paul Eggert ([EMAIL PROTECTED]): 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': snprintf.c:230: warning: subscript has type `char' snprintf.c:254: warning: subscript has type `char' This is

Re: wget 1.6 porting problem with snprintf and isdigit on Solaris 2.5.1

2001-04-08 Thread Paul Eggert
Date: Sun, 8 Apr 2001 12:05:35 +0200 From: Jan Prikryl [EMAIL PROTECTED] Wouldn't just an explicit type cast to `(unsigned char)ch' suffice? That would work for now, but it won't work if wget got properly internationalized. That is because isdigit(x) succeeds for non-ASCII digits in some

Re: wget 1.6 porting problem with snprintf and isdigit on Solaris 2.5.1

2001-04-08 Thread Hrvoje Niksic
Paul Eggert [EMAIL PROTECTED] writes: That would work for now, but it won't work if wget got properly internationalized. That is because isdigit(x) succeeds for non-ASCII digits in some locales. Some locales have multiple ways to represent the decimal digits, and some locales even have

Re: wget 1.6 porting problem with snprintf and isdigit on Solaris 2.5.1

2001-04-08 Thread Hrvoje Niksic
Russ Allbery [EMAIL PROTECTED] writes: That's why Wget 1.7 incorporates its own implementation of IS* macros (from Gcc) and uses them consistently. Except in snprintf.c, which is not part of Wget proper. *sigh* ...since snprintf.c isn't part of wget proper, it *might* be called in a

Re: wget 1.6 porting problem with snprintf and isdigit on Solaris 2.5.1

2001-04-08 Thread Russ Allbery
Hrvoje Niksic [EMAIL PROTECTED] writes: The problem is, I'm not sure there is an upstream version of snprintf.c. As you know, it is used by several different projects. That's why I'm trying to avoid changing it, unless it is absolutely necessary. I'd been assuming

Re: wget 1.6 porting problem with snprintf and isdigit on Solaris 2.5.1

2001-04-08 Thread Paul Eggert
From: Hrvoje Niksic [EMAIL PROTECTED] Date: 08 Apr 2001 23:06:32 +0200 In the general case (other is* macros), such hacked-up code is probably slower than table lookups. For the special case of isdigit, '0'=x x='9' is usually faster than table lookups. Decent compilers like GCC optimize