Invalid use of 2nd arg to setAttributeList() in lib/parser-sming.y from 0.4.8

In lib/parser-sming.y from 0.4.8: bitsOrEnumerationSpec { List *p;
$$ = duplicateTypeToAttribute(smiHandle->typeBitsPtr, classPtr, thisParserPtr); setAttributeParentType($$, smiHandle->typeBitsPtr); if ($1) { setAttributeList($$, $1); for (p = $1; p; p = p->nextPtr) ((NamedNumber *)(p->ptr))->typePtr = (Type*)$$; }
bitsFlag = 0; /* reset flag */ } }
In lib/parser-sming.c, this expands to: typedef union YYSTYPE { char *id; /* identifier name */ int rc; /* >=0: ok, <0: error */ ... } ...
{ List *p;
(yyval.attributePtr) = duplicateTypeToAttribute(smiHandle->typeBitsPtr, classPtr, thisParserPtr); setAttributeParentType((yyval.attributePtr), smiHandle->typeBitsPtr); if ((yyvsp[(1) - (3)].rc)) { setAttributeList((yyval.attributePtr), (yyvsp[(1) - (3)].rc)); for (p = (yyvsp[(1) - (3)].rc); p; p = p->nextPtr) ((NamedNumber *)(p->ptr))->typePtr = (Type*)(yyval.attributePtr); }
bitsFlag = 0; /* reset flag */ ;} break;
yyvsp is of type YYVSP so (yyvsp[(1) - (3)].rc) is of type int. But, the prototype of setAttributeList() according to data.h is: extern void setAttributeList(Attribute *attributePtr, List *listPtr);
So, how is the above code expected to work?
participants (1)
-
Albert Chin