Hacker News new | ask | show | jobs
by pjmlp 1971 days ago
VLAs are optional since ISO C11, clang and gcc are probably the only C compilers that care to support them.

C17 also has its share of keywords and C2X plans to replace some of the _Keyword with they keyword version, as enough time has passed since their introduction.

1 comments

Clang and GCC being the two largest implementations.
True, but not the only ones, so good luck making that VLA code work outside BSD/Linux clones or the few OEM vendors that have forked them.

Also Google has sponsored the work to clean Linux kernel from VLAs.

Yeah, because VLAs mostly suck.
I have some perfectly safe code using them that crashes Intel icc. Useful if you ever need to, I don't know, crash icc I guess.

Among other things, this means icc doesn't run other compilers' testsuites, because I reported the same bug in the first release of clang and clattner fixed it right away.

And given that C11 made them optional, Intel can just close such bug reports with won't fix using the ISO as justification.
Not if it claims GCC compatibility, which it does. Though I believe the frontend is licensed from EDG anyway.