sym->rname,
SPEC_ADDR (sym->etype));
}
- else
- {
+ else {
if (newSym) {
- // this has been moved to another segment
+ // this has been moved to another segment
} else {
- /* allocate space */
- if (options.debug) {
- fprintf (map->oFile, "==.\n");
- }
- if (IS_STATIC (sym->etype))
- tfprintf (map->oFile, "!slabeldef\n", sym->rname);
- else
- tfprintf (map->oFile, "!labeldef\n", sym->rname);
- tfprintf (map->oFile, "\t!ds\n",
- (unsigned int) getSize (sym->type) & 0xffff);
+ int size = getSize (sym->type);
+ if (size==0) {
+ werror(E_UNKNOWN_SIZE,sym->name);
+ }
+ /* allocate space */
+ if (options.debug) {
+ fprintf (map->oFile, "==.\n");
+ }
+ if (IS_STATIC (sym->etype))
+ tfprintf (map->oFile, "!slabeldef\n", sym->rname);
+ else
+ tfprintf (map->oFile, "!labeldef\n", sym->rname);
+ tfprintf (map->oFile, "\t!ds\n",
+ (unsigned int) size & 0xffff);
}
- }
+ }
}
}
printIval (sym, sym->type, sym->ival, out);
noAlloc--;
}
- else
- {
+ else {
/* allocate space */
+ int size = getSize (sym->type);
+
+ if (size==0) {
+ werror(E_UNKNOWN_SIZE,sym->name);
+ }
fprintf (out, "%s:\n", sym->rname);
/* special case for character strings */
if (IS_ARRAY (sym->type) && IS_CHAR (sym->type->next) &&
SPEC_CVAL (sym->etype).v_char)
- printChar (out,
- SPEC_CVAL (sym->etype).v_char,
- strlen (SPEC_CVAL (sym->etype).v_char) + 1);
+ printChar (out,
+ SPEC_CVAL (sym->etype).v_char,
+ strlen (SPEC_CVAL (sym->etype).v_char) + 1);
else
- tfprintf (out, "\t!ds\n", (unsigned int) getSize (sym->type) & 0xffff);
+ tfprintf (out, "\t!ds\n", (unsigned int) size & 0xffff);
}
}
}
sym->rname,
SPEC_ADDR (sym->etype));
}
- else
- {
+ else {
+ int size = getSize(sym->type);
+
+ if (size==0) {
+ werror(E_UNKNOWN_SIZE,sym->name);
+ }
if (options.debug)
- fprintf (afile, "==.\n");
+ fprintf (afile, "==.\n");
/* allocate space */
tfprintf (afile, "!labeldef\n", sym->rname);
tfprintf (afile, "\t!ds\n", (unsigned int) getSize (sym->type) & 0xffff);
- }
-
+ }
+
}
}
}
if (DCL_ELEM(p)) {
return DCL_ELEM (p) * getSize (p->next);
} else {
- werror (E_INTERNAL_ERROR, __FILE__, __LINE__,
- "can not tell the size of an array[]");
+ // werror (E_INTERNAL_ERROR, __FILE__, __LINE__,
+ // "can not tell the size of an array[]");
return 0;
}
case IPOINTER:
sum += getSize (loop->type);
}
-#if 0 // jwk: this is done now in addDecl()
- /* if function then do the arguments for it */
- if (funcInChain (loop->type)) {
- processFuncArgs (loop);
- }
-#endif
-
loop = loop->next;
/* if this is not a bitfield but the */