Better HN
top
new
best
ask
show
jobs
Log in
Sign up
Better HN
Comment
by
nj5rq
· 2y ago · 0 comments
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?
Comments
[–]
G4E
2y ago
Unless it has been recently standardized it's not valid C, it's a GNU extension.
[–]
dekhn
2y 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).
[–]
nj5rq
OP
2y ago
I just tried it, and it works with clang version 17.0.6.
[–]
astrange
2y ago
Clang supports almost all GNU C extensions. Maybe not nested functions because they need executable stacks.