break;
case ENUM:
+ /* note: this code accepts silly declarations like "enum a int b;" */
+ /* it also accepts modifiers if placed later like "enum a long b;" */
+ /* eventually we should modify this to be more like the struct case */
if (longf || unsignf)
error0("Perverse modifier on 'enum'");
- /* strdec(ismos, cval);*/
- if (dtype)
- error0("type clash");
- dtype = (struct type *)strdec(ismos, cval);
+ strdec(ismos, cval);
cval = INT;
goto types;
error0("type clash");
dtype = (struct type *)strdec(ismos, cval);
cval = STRUCT;
- goto types;
+ goto types_struct;
case INT:
case CHAR:
case FLOAT:
case DOUBLE:
case VOID:
+ types:
if (dtype)
goto type_clash;
- types:
+ types_struct:
if (tkw>=0 && (tkw!=INT || cval!=INT))
type_clash:
error0("Type clash");
struct nmlist *mems[NMEMS];
/* struct nmlist typer;*/
int tagkind;
+ static struct type t_int = {INT};
if (kind!=ENUM) {
tagkind = STRTAG;
bitoffs = 0;
if (kind==ENUM) {
/* typer.nl_type = INT;
- typer.nl_strp = strp;
- declare(ENUM, &typer, 0);*/
- abort();
+ typer.nl_strp = strp;*/
+ /* strp above seems to be vestigial, I don't think it is ever referenced */
+ declare(ENUM, /*&typer*/&t_int, 0);
} else
elsize = declist(kind==UNION?MOU:MOS);
bitoffs = savebits;