Y
Hacker News
new
|
ask
|
show
|
jobs
by
nj5rq
723 days ago
Why did I not know that this:
case 1 ... 10:
Is valid C? I have been programming in C for years, what standard is this from?
2 comments
G4E
723 days ago
Unless it has been recently standardized it's not valid C, it's a GNU extension.
link
dekhn
723 days ago
It appears to be a GNU C extension:
https://gcc.gnu.org/onlinedocs/gcc/Case-Ranges.html
but I couldn't find the history of the extension. I believe it is not in standard C (not sure about clang).
link
nj5rq
723 days ago
I just tried it, and it works with clang version 17.0.6.
link
astrange
723 days ago
Clang supports almost all GNU C extensions. Maybe not nested functions because they need executable stacks.
link