After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 319611 - XML_DEFAULT_VERSION should include required cast
XML_DEFAULT_VERSION should include required cast
Status: RESOLVED WONTFIX
Product: libxml2
Classification: Platform
Component: general
2.6.21
Other Linux
: Normal normal
: ---
Assigned To: Daniel Veillard
libxml QA maintainers
Depends on:
Blocks:
 
 
Reported: 2005-10-24 14:54 UTC by Ross Burton
Modified: 2005-10-24 20:02 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description Ross Burton 2005-10-24 14:54:57 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"
Comment 1 Daniel Veillard 2005-10-24 15:27:41 UTC
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
Comment 2 Ross Burton 2005-10-24 15:35:50 UTC
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. :)
Comment 3 Daniel Veillard 2005-10-24 20:02:45 UTC
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