3 ms·
The following code crashes the compiler but is accepted by GCC. static float b5[0][0] = {}; int main(void) { return 0; } I have filed
by lindig 11y ago
The following code crashes the compiler but is accepted by GCC.
static float b5[0][0] = {};
int main(void)
{
return 0;
}
I have filed a bug report.
- PeCaN 11y ago0-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.
- qznc 11y agoThanks for the bug report! :)
- Rotluchs 11y agoFixed, thanks for the report. (: (stupid gcc extensions sigh)
- jevinskie 11y agoHowdy! Very interesting project, coming from an avid LLVM user. Do you or your organization have a Twitter/FB/social page and/or GitHub page?
- Rotluchs 11y agoWe have an IRC channel (#firm on FreeNode), a mailing list (see libfirm.org) and there are github mirrors for cparser (https://github.com/MatzeB/cparser https://github.com/MatzeB/cparser) and libfirm (https://github.com/MatzeB/libfirm/ https://github.com/MatzeB/libfirm/). If you want to report a bug, there's our bugtracker (also linked on libfirm.org)