Re: [xslt] Help with compiling libxslt on HP-UX



On Wed, Jul 16, 2003 at 01:08:27PM -0400, MATHIHALLI,MADHUSUDAN (HP-Cupertino,ex1) wrote:
> Hi,
> 	I'm trying to use the libxml2 (2.4.23) and libxslt (1.0.9) for some
> PHP extensions, and I'm running into the following build problem (only on
> newer compilers - it works on HP-UX 11.0):
> 
> Warning 684: "numbers.c", line 90 # Integer constant 65296 = 0xFF10 is out
> of
>     range for type unsigned char
>         case 0x17E0: case 0x1810: case 0xFF10:
>                                        ^^^^^^ 
> Error 295: "numbers.c", line 90 # Switch cases must be distinct. This case
>     also appears at ["numbers.c", line 90].
>         case 0x17E0: case 0x1810: case 0xFF10:
>                           ^^^^^^              
> 
> When I investigated further, I found that the problem is because the type
> "xmlChar" is defined as a "unsigned char" in include/libxml/tree.h (so, it's
> 1 byte long), and the switch statement assumes that xmlChar holds a UTF-8
> character (and hence assumes the size of xmlChar to be 2 bytes, and checks
> for 0x17E0...).

  Hum, seems the best is to switch to function signature to:

static int
xsltIsDigitZero(unsigned int ch)

  Honnestly I'm a bit lost on why the function should work with an 
xmlChar, seems it's testing against unicode values but it is used to 
test subsequent bytes in an xmlChar UTF-8 string. Maybe from an XSLT
point of view only ASCII is allowed there but the IsDigitZero test
is defined in term of Unicode code point. If this is the case then
changing the signature should be fine. Since it's static it should
not affect compatibility.

Daniel

-- 
Daniel Veillard      | Red Hat Network https://rhn.redhat.com/
veillard@redhat.com  | libxml GNOME XML XSLT toolkit  http://xmlsoft.org/
http://veillard.com/ | Rpmfind RPM search engine http://rpmfind.net/



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]