[Vala] A little warning about qualifier.



Is it already fixed in trunk?


dom-element.c: In function 'dom_element_getAttribute':
dom-element.c:56: warning: assignment discards qualifiers from pointer target type


const char* dom_element_getAttribute (DOMElement* self, const char* name) {
    DOMAttr* attr;
    char* _tmp0;
~~~~~~~~~~~~~~~~~~
    g_return_val_if_fail (self != NULL, NULL);
    g_return_val_if_fail (name != NULL, NULL);
    attr = dom_element_getAttributeNode (self, name);
    _tmp0 = NULL;
    return (_tmp0 = dom_attr_get_value (attr), (attr == NULL ? NULL : (attr = (dom_node_unref (attr), 
NULL))), _tmp0);
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
}

dom_attr_get_value returns a string, which is translated to a const char *;
dom_element_getAttribute also returns a string, which is translated to a const char *;

Therefore the intermediate variable _tmp0 should also be const char *.

Best,

Yu




[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]