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

Unless it has been recently standardized it's not valid C, it's a GNU extension.
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).
I just tried it, and it works with clang version 17.0.6.
Clang supports almost all GNU C extensions. Maybe not nested functions because they need executable stacks.