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:
>   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

I'm afraid I can't agree with this.  Although this change will
certainly fix the compilation error, it isn't fixing the underlying
problem - the function xsltIsDigitZero (#define'd to be
IS_DIGIT_ZERO, and also used by the #define IS_DIGIT_ONE) is called
from a couple of places in the subsequent code, and in each case the
argument is an xmlChar (unsigned char).  If the underlying data is
actually a multi-byte Unicode character (i.e. a codepoint '0' value
other than 0x0030) only the first byte is evaluated, and the test
will fail. In other words, the existing code (not just this
function, but also the subsequent code which calls it) is not
correct, and the HP compiler very kindly caught it for us.  I'll try
to get it fixed properly, but first I need to compose some test data
to show how it currently fails, and to prove that any enhancement I
make fixes it.


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