GNOME Bugzilla – Bug 530369
Length function transform pointer to gpointer
Last modified: 2008-05-26 12:31:27 UTC
Please describe the problem: Hello, length method cast _this_ parameter in gpointer. This make problem when C function is a macro. An example with Xml.NodeSet.length: -------------------------------------------------------------------------------- Xml.NodeSet* node = ...; nodes->length (); -------------------------------------------------------------------------------- is transformed to c code: -------------------------------------------------------------------------------- xmlXPathNodeSetGetLength (((gpointer) nodes)); -------------------------------------------------------------------------------- but xmlXPathNodeSetGetLength is macro extend to: -------------------------------------------------------------------------------- ((ns) ? (ns)->nodeNr : 0) -------------------------------------------------------------------------------- Makes an error: -------------------------------------------------------------------------------- warning: dereferencing 'void *' pointer error: request for member 'nodeNr' in something not a structure or union -------------------------------------------------------------------------------- Steps to reproduce: Actual results: Expected results: Does this happen every time? Other information: I don't know if that is specific to this Xml.NodeSet.length function.
Confirming. void main () { Xml.NodeSet* nodes; int i = nodes->length (); }
I have same problem with xmlXPathNodeSetItem macro.
Hello, This problem prevents me to continue the development of a project. Is there a solution, even temporary, to compile my project?
2008-05-26 Jürg Billeter <j@bitron.ch> * gobject/valaccodeinvocationexpressionbinding.vala: Fix implicit casts for instances in invocation expressions, fixes bug 530369 Fixed in r1449.