3 ms·
In C: - Allow labels to be followed by variable declarations or the end of a block. - Change switch to make each case its own block, and not fall through by d
by comex 15y ago
In C:
- Allow labels to be followed by variable declarations or the end of a block.
- Change switch to make each case its own block, and not fall through by default (but add a keyword to explicitly fall through).
- Support labeled break and continue (often much clearer than goto; sometimes separating the inner loop into its own function is clearer than either, but not always).
- Change the precedence of & and |.
- In do/while, evaluate the loop condition within the block's scope:
do { int a = ...; } while(a);
- Allow variable declarations anywhere in an expression: not just
while(int a = ...)
as in C++, but even
while((int a = ...) == 0)
or
getvalue(&(int a));
- Standardize some GNU extensions such as ({ }), void pointer arithmetic, __attribute__((pure)), and __builtin_unreachable().
- Standardize visibility.
- Standardize Apple blocks.
- Tuples, with quick unpacking:
{int a, bool ok} = func();
- Explicit control of may-alias, something more powerful than restrict.
...This is fun.