Re: Add 'const' to string casts?

Daniel Veillard <[email protected]> Fri, 7 Sep 2012 12:24:14 +0800
Newsgroups gmane.comp.gnome.lib.xslt
Message-ID <[email protected]>
On Tue, Sep 06, 2011 at 01:06:20PM -0400, Phil Shafer wrote:
> gcc dislikes this cast (in xslt.h):
> 
>     /**
>      * XSLT_NAMESPACE:
>      *
>      * The XSLT specification namespace.
>      */
>     #define XSLT_NAMESPACE ((xmlChar *) "http://www.w3.org/1999/XSL/Transform")
> 
> The error is:
> 
>     warning: cast discards qualifiers from pointer target type
> 
> Can this be changed to:
> 
>     #define XSLT_NAMESPACE ((const xmlChar *) "http://www.w3.org/1999/XSL/Transform")
> 
> to avoid the warning?

  yes, makes sense, pushed :-)

Daniel

-- 
Daniel Veillard      | libxml Gnome XML XSLT toolkit  http://xmlsoft.org/
[email protected]  | Rpmfind RPM search engine http://rpmfind.net/
http://veillard.com/ | virtualization library  http://libvirt.org/