Open edubart opened 3 years ago
As per the C spec, program's behavior is undefined if a struct is empty. So you generally should avoid using it.
https://www.sigbus.info/n1570#6.7.2.1p8
That being said, gcc and clang handle empty structs as a one-byte object, and chibicc should mimic that behavior for the compatibility with the compilers.
I am trying to use chibicc with some tool that generates C code with empty structs and I get some assertions when compiling, here is a small test case:
Output: