在我之前的问题之后:
现在我有这个:
xml_list *text1(xml_list *);
xml_list *text(xml_list *);
//operation: text1(elem)
xml_list *text1(xml_list *elem){
if(isText(elem)){
return Cons(elem,Nil());
}
else{
return text(childeren(elem));
}
}
//operation: text(elem)
xml_list *text(xml_list *elem){
if(isEmpty(elem)){
return Nil();
}
return append(text1(head(elem)),text(tail(elem)));
}
当我运行它时,我收到 xml_list *text1 的警告:
incompatible pointer types passing 'xml_list *' (aka 'struct xml_list_struct *') to parameter of type 'xml *' (aka 'struct xml_struct *') [-Wincompatible-pointer-types]
if(isText(elem)){
下一行还有这个警告:
warning: incompatible pointer types passing 'xml_list *' (aka 'struct xml_list_struct *') to parameter of type 'xml *' (aka 'struct xml_struct *') [-Wincompatible-pointer-types]
return Cons(elem,Nil());
再次警告:
warning: incompatible pointer types passing 'xml_list *' (aka 'struct xml_list_struct *') to parameter of type 'xml *' (aka 'struct xml_struct *') [-Wincompatible-pointer-types]
return text(children(elem));
我怎样才能让这些警告消失?