1
0
mirror of https://github.com/cc65/cc65.git synced 2024-06-07 23:29:39 +00:00

Disallowed struct/union types of 0 size as cc65 is not ready to support them.

This commit is contained in:
acqn 2020-08-05 00:19:28 +08:00 committed by Oliver Schmidt
parent 4dfc1a5ded
commit 97065faf1a

View File

@ -919,6 +919,11 @@ NextMember: if (CurTok.Tok != TOK_COMMA) {
FieldTab = GetSymTab ();
LeaveStructLevel ();
/* Empty union is not supported now */
if (UnionSize == 0) {
Error ("Empty union type '%s' is not supported", Name);
}
/* Make a real entry from the forward decl and return it */
return AddStructSym (Name, SC_UNION | SC_DEF, UnionSize, FieldTab);
}
@ -1101,6 +1106,11 @@ NextMember: if (CurTok.Tok != TOK_COMMA) {
FieldTab = GetSymTab ();
LeaveStructLevel ();
/* Empty struct is not supported now */
if (StructSize == 0) {
Error ("Empty struct type '%s' is not supported", Name);
}
/* Make a real entry from the forward decl and return it */
return AddStructSym (Name, SC_STRUCT | SC_DEF, StructSize, FieldTab);
}