GNOME Bugzilla – Bug 319611
XML_DEFAULT_VERSION should include required cast
Last modified: 2005-10-24 20:02:45 UTC
This code: dest_doc = xmlNewDoc (XML_DEFAULT_VERSION); produces this error: warning: pointer targets in passing argument 1 of 'xmlNewDoc' differ in signedness when compiled with gcc 4. Shouldn't this: #define XML_DEFAULT_VERSION "1.0" be: #define XML_DEFAULT_VERSION (const xmlChar*)"1.0"
Well, doing so raises the opposite warning from some code within libxml2, so I expect other users of libxml2 code to have the same problem if I do this. So why should I break existing code instead to accomodate source being built now ? I'm not saying no, I wonder why you think changing this should be done ? Daniel
I'm surprised that making this change causes warnings inside libxml2. XML_DEFAULT_VERSION in my opinion was intended to be an xmlChar*, as it is the argument to xmlNewDoc(). If you don't agree that this cast should be applied, then it's probably best to close this now. :)
Well it is currently defined as a const char * and as a result there are uses in the library where it is expected signed... I admit it sounds a bit incoherent but that has been the status quo for years... So let's close as WONTFIX, this could have been a good idea, thanks ! Daniel