1
0
mirror of https://github.com/cc65/cc65.git synced 2024-12-23 04:30:10 +00:00

Improved error messages on struct/union type multiple definitions.

This commit is contained in:
acqn 2020-08-08 20:12:04 +08:00 committed by Oliver Schmidt
parent fe3f726fd6
commit b62b1650f5

View File

@ -761,7 +761,11 @@ SymEntry* AddStructSym (const char* Name, unsigned Flags, unsigned Size, SymTabl
Entry = 0;
} else if ((Entry->Flags & Flags & SC_DEF) == SC_DEF) {
/* Both structs are definitions. */
Error ("Multiple definition for '%s'", Name);
if (Type == SC_STRUCT) {
Error ("Multiple definition for 'struct %s'", Name);
} else {
Error ("Multiple definition for 'union %s'", Name);
}
Entry = 0;
} else {
/* Define the struct size if it is a definition */