case TOK_CONST:
if (Q & T_QUAL_CONST) {
- Error (ERR_DUPLICATE_QUALIFIER, "const");
- }
+ Error ("Duplicate qualifier: `const'");
+ }
Q |= T_QUAL_CONST;
break;
case TOK_VOLATILE:
if (Q & T_QUAL_VOLATILE) {
- Error (ERR_DUPLICATE_QUALIFIER, "volatile");
+ Error ("Duplicate qualifier: `volatile'");
}
Q |= T_QUAL_VOLATILE;
break;
/* We expect an identifier */
if (curtok != TOK_IDENT) {
- Error (ERR_IDENT_EXPECTED);
+ Error ("Identifier expected");
continue;
}
Entry = AddStructSym (Name, 0, 0);
} else if (SymIsLocal (Entry) && (Entry->Flags & SC_STRUCT) == 0) {
/* Already defined in the level but no struct */
- Error (ERR_SYMBOL_KIND);
+ Error ("Symbol `%s' is already different kind", Name);
}
return Entry;
}
Entry = FindTagSym (CurTok.Ident);
if (Entry) {
if (SymIsLocal (Entry) && (Entry->Flags & SC_ENUM) == 0) {
- Error (ERR_SYMBOL_KIND);
+ Error ("Symbol `%s' is already different kind", Entry->Name);
}
} else {
/* Insert entry into table ### */
/* Skip the identifier */
NextToken ();
} else {
- Error (ERR_IDENT_EXPECTED);
+ Error ("Identifier expected");
}
}
/* Remember we have an extra type decl */
default:
if (Default < 0) {
- Error (ERR_TYPE_EXPECTED);
+ Error ("Type expected");
D->Type[0] = T_INT;
D->Type[1] = T_END;
} else {
/* List of identifiers expected */
if (curtok != TOK_IDENT) {
- Error (ERR_IDENT_EXPECTED);
+ Error ("Identifier expected");
}
/* Create a symbol table entry with type int */
/* An optional list of type specifications follows */
while (curtok != TOK_LCURLY) {
- DeclSpec Spec;
+ DeclSpec Spec;
/* Read the declaration specifier */
ParseDeclSpec (&Spec, SC_AUTO, T_INT);
*/
if ((Spec.StorageClass & SC_AUTO) == 0 &&
(Spec.StorageClass & SC_REGISTER) == 0) {
- Error (ERR_ILLEGAL_STORAGE_CLASS);
+ Error ("Illegal storage class");
}
/* Parse a comma separated variable list */
/* Found it, change the default type to the one given */
ChangeSymType (Sym, ParamTypeCvt (Decl.Type));
} else {
- Error (ERR_UNKNOWN_IDENT, Decl.Ident);
+ Error ("Unknown identifier: `%s'", Decl.Ident);
}
}
*/
if ((Spec.StorageClass & SC_AUTO) == 0 &&
(Spec.StorageClass & SC_REGISTER) == 0) {
- Error (ERR_ILLEGAL_STORAGE_CLASS);
+ Error ("Illegal storage class");
}
Spec.StorageClass = SC_AUTO | SC_PARAM | SC_DEF;
* parameters.
*/
if (ANSI && (F->Flags & FD_UNNAMED_PARAMS) != 0) {
- Error (ERR_MISSING_PARAM_NAME);
+ Error ("Parameter name omitted");
}
}
}
Decl (D, Mode);
/* Set the fastcall flag */
if (!IsTypeFunc (T)) {
- Error (ERR_ILLEGAL_MODIFIER);
+ Error ("__fastcall__ modifier applied to non function");
} else {
FuncDesc* F = DecodePtr (T+1);
F->Flags |= FD_FASTCALL;
NextToken ();
} else {
if (Mode == DM_NEED_IDENT) {
- Error (ERR_IDENT_EXPECTED);
+ Error ("Identifier expected");
}
D->Ident[0] = '\0';
return;
/* Check the size of the generated type */
if (!IsTypeFunc (D->Type) && !IsTypeVoid (D->Type) && SizeOf (D->Type) >= 0x10000) {
- Error (ERR_ILLEGAL_SIZE);
+ if (D->Ident[0] != '\0') {
+ Error ("Size of `%s' is invalid", D->Ident);
+ } else {
+ Error ("Invalid size");
+ }
}
}
break;
default:
- Error (ERR_ILLEGAL_TYPE);
+ Error ("Illegal type in initialization");
break;
}
*/
Tab = Entry->V.S.SymTab;
if (Tab == 0) {
- Error (ERR_INIT_INCOMPLETE_TYPE);
+ Error ("Cannot initialize variables with incomplete type");
/* Returning here will cause lots of errors, but recovery is difficult */
return;
}
Entry = Tab->SymHead;
while (curtok != TOK_RCURLY) {
if (Entry == 0) {
- Error (ERR_TOO_MANY_INITIALIZERS);
+ Error ("Too many initializers");
return;
}
ParseInit (Entry->Type);
} else if (count < sz) {
g_zerobytes ((sz - count) * SizeOf (T + DECODE_SIZE + 1));
} else if (count > sz) {
- Error (ERR_TOO_MANY_INITIALIZERS);
+ Error ("Too many initializers");
}
break;
/* FALLTHROUGH */
default:
- Error (ERR_ILLEGAL_TYPE);
+ Error ("Illegal type");
break;
}