}
/*------------------------------------------------------------------*/
-/* structElemType - returns the type info of a sturct member */
+/* structElemType - returns the type info of a struct member */
/*------------------------------------------------------------------*/
sym_link *
structElemType (sym_link * stype, value * id)
etype = getSpec (type);
SPEC_SCLS (etype) = (SPEC_SCLS (petype) == S_REGISTER ?
SPEC_SCLS (etype) : SPEC_SCLS (petype));
+ if (IS_SPEC (type))
+ SPEC_CONST (type) |= SPEC_CONST (stype);
+ else
+ DCL_PTR_CONST (type) |= SPEC_CONST (stype);
return type;
}
fields = fields->next;
#endif
/* if either of them unsigned but not val then make this unsigned */
- if (((/*!IS_LITERAL(type1) &&*/ SPEC_USIGN (etype1)) ||
- (/*!IS_LITERAL(type2) &&*/ SPEC_USIGN (etype2))) &&
+ if ((SPEC_USIGN (etype1) || SPEC_USIGN (etype2)) &&
!IS_FLOAT (reType))
SPEC_USIGN (reType) = 1;
else
werror(E_PARAM_NAME_OMITTED, sym->name, argCnt);
}
}
+ argCnt--;
if (!csym && !(csym = findSym (SymbolTab, sym, sym->name)))
return 1; /* not defined nothing more to check */
{
werror (E_PREV_DEF_CONFLICT, csym->name, "_naked");
}
+
+ /* Really, reentrant should match regardless of argCnt, but */
+ /* this breaks some existing code (the fp lib functions). If */
+ /* the first argument is always passed the same way, this */
+ /* lax checking is ok (but may not be true for in future ports) */
+ if (IFFUNC_ISREENT (csym->type) != IFFUNC_ISREENT (sym->type)
+ && argCnt>1)
+ {
+ //printf("argCnt = %d\n",argCnt);
+ werror (E_PREV_DEF_CONFLICT, csym->name, "reentrant");
+ }
/* compare expected args with actual args */
exargs = FUNC_ARGS(csym->type);