4 ms·
0-length arrays are a GNU C extension[1]. In ISO C99, they're only permitted as the last member of a struct with another member, and are written with an empty
by PeCaN 11y ago
0-length arrays are a GNU C extension[1].
In ISO C99, they're only permitted as the last member of a struct with another member, and are written with an empty pair of brackets[] and no 0.
1. https://gcc.gnu.org/onlinedocs/gcc/Zero-Length.html https://gcc.gnu.org/onlinedocs/gcc/Zero-Length.html
- lindig 11y agoThe compiler is described on its home page as "accompanying GCC-compatible C frontend." So what does this mean with respect to GCC features? In any case, I don't think the compiler should crash but report a syntax error.
- Rotluchs 11y agoIt's sufficiently compatible to handle e.g. glibc, which is quite a feat, because it uses many and somewhat obscure gcc extensions.