2 ms·
You are right. OP has it backwards. gcc treats someArray[0] almost the same as someArray[]. https://gcc.gnu.org/onlinedocs/gcc-5.1.0/gcc/Zero-Length.html#Zero
by sigjuice 10y ago
You are right. OP has it backwards. gcc treats someArray[0] almost the same as someArray[].
https://gcc.gnu.org/onlinedocs/gcc-5.1.0/gcc/Zero-Length.html#Zero-Length https://gcc.gnu.org/onlinedocs/gcc-5.1.0/gcc/Zero-Length.htm...
Other compilers might have similar treatment for someArray[0].
- tavert 10y agoJust don't try to have both a zero sized array and a flexible array in the same struct. g++ 5 or earlier will compile that, but g++ 6 will not: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=69550 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=69550