|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull Requests |
|||||||||||||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Sun Nov 02 17:00:02 2025 UTC |
Description: ------------ Warnings while compiling xml.c with 4.3.3 as well as php4-STABLE-200311020830: ext/xml/xml.c: In function `xml_utf8_encode': ext/xml/xml.c:489: warning: comparison is always true due to limited range of data type ext/xml/xml.c:493: warning: comparison is always true due to limited range of data type Relevant lines in xml.c are: 0455: static XML_Char *xml_utf8_encode(const char *s, int len, int *newlen, const XML_Char *encoding) 0459: unsigned short c; 0484: if (c < 0x80) { 0486: } else if (c < 0x800) { 0489: } else if (c < 0x10000) { 0493: } else if (c < 0x200000) { On Darwin, a short seems to be a 32 bit value; comparisons at lines 0489 and 0493 are thus, indeed, always true. Now, function xml_utf8_encode seems to be used only for implementing utf8_encode(), thus for encoding iso-8559-1 into UTF-8. So, one could be tempted to consider those warnings as "don't care" ones. On the other hand, it seems that those warnings could be easily avoided and thus allow for easier code maintenance. HTH, Axel