The C++ standard requires that all types are at least 1 byte in size even though a struct has no members. i.e.
struct x { };
but
sizeof(x) == 1
Same is with arrays. It is not standard conforming to declare zero length arrays (in C, C++ and C99).
int x[0]; // not allowed in C, C++ and C99 standards
So why is that? To me it seems like an uneccessary requirement, that actually introduces inconsistency.
I know that some compilers allow zero length arrays as an extention, and also that C99 allows a "zero" length array at the end of a structure, which is however more of a variable length array and only possible at the end of a struct.
So my question is: what is the rationale behind fobidding zero length arrays or requiring sizeof > 0 in the language standards?