for (; sym != NULL; sym = sym->next)
{
- changePointer(sym);
+ changePointer(sym->type);
checkTypeSanity(sym->etype, sym->name);
if (!sym->level && !(IS_SPEC(sym->etype) && IS_TYPEDEF(sym->etype)))
loop = loop->next;
- /* if union then size = sizeof larget field */
+ /* if union then size = sizeof largest field */
if (su == UNION) {
/* For UNION, round up after each field */
sum += ((bitOffset+7)/8);
/* initializers if not an extern */
if (SPEC_SCLS (sym->etype) == S_CODE &&
sym->ival == NULL &&
+ !sym->_isparm &&
//!sym->level &&
port->mem.code_ro &&
!IS_EXTERN (sym->etype) &&
/* changePointer - change pointer to functions */
/*------------------------------------------------------------------*/
void
-changePointer (symbol * sym)
+changePointer (sym_link * p)
{
- sym_link *p;
/* go thru the chain of declarations */
/* if we find a pointer to a function */
/* unconditionally change it to a ptr */
/* to code area */
- for (p = sym->type; p; p = p->next)
+ for (; p; p = p->next)
{
if (!IS_SPEC (p) && DCL_TYPE (p) == UPOINTER)
DCL_TYPE (p) = port->unqualified_pointer;
{
checkSClass (sym, isProto); /* check the storage class */
- changePointer (sym); /* change pointers if required */
+ changePointer (sym->type); /* change pointers if required */
/* if this is an array without any dimension
then update the dimension from the initial value */
return compareType (dest->next, src->next);
}
if (IS_PTR (dest) && IS_GENPTR (src) && IS_VOID(src->next)) {
- return 1;
+ return -1;
}
if (IS_PTR (src) && IS_GENPTR (dest))
return -1;
/* change it to pointer to the same type */
while (val)
{
- int argreg = 0;
+ int argreg = 0;
+ char buffer[SDCC_NAME_MAX+1];
+
+ SNPRINTF (buffer, sizeof(buffer), "%s parameter %d", func->name, pNum);
+ checkTypeSanity (val->etype, buffer);
+
/* mark it as a register parameter if
the function does not have VA_ARG
and as port dictates */