Is it possible for the sizeof operator to ever return 0 (zero) in C or C++? If it is possible, is it correct from a standards point of view?
If you have this :
struct Foo {}; struct Bar { Foo v[]; }
g++ -ansi returns sizeof(Bar) == 0. As does the clang & intel compiler.
g++ -ansi
However, this does not compile with gcc. I deduce it's a C++ extension.