173 points · by graderjs · 4y ago · 76 comments
For instance in the whole network stack, some "agents of the planned obsolescence" did not use constant expressions in switch/case statements or initializers. Also tell those who are using that toxic c11 "Generic" keyword to use explicit code instead. I think, the main issue for C now is the standard body trying to obsolete stable in time C code and forcing upon devs/integrators the usage of the only few compilers which are able to follow fast enough their tantrums (latest gcc/latest clang). Results: all attempts to provide "working" alternative C compilers is beyond reasonable. This is becoming so accute, it is more likely to be a worldwide scam than anything else.
Yep, open source software is not enough anymore, it needs to be lean, simple but able to do reasonably "the job", and ofc very stable in time hence C89 only with benign bits of c99/c11, or "standard assembly".
As you seem to care about this, have you made this argument on LKML yourself? What Linux kernel related work are you active on that drives your position?
Its nicely documented on LWN https://lwn.net/SubscriberLink/885941/01fdc39df2ecc25f/
It was also discussed here on HN https://news.ycombinator.com/item?id=30459634
I mean you can't even write an allocator in standard C.
I might be missing something, but I don't believe this is true? The type aliasing rules have an explicit carve-out for `char *` aliases of other types, which is intended to solve this exact issue.
Similarly, C99 and C11 both allow aliasing through a union of pointers without violating the strict aliasing rule.
This is because of the particulars of the C language. For instance, the way it handles arrays and pointer arithmetic make it difficult to detect every instance of out-of-bounds access.
[0] -fwrapv, see https://gcc.gnu.org/onlinedocs/gcc/Code-Gen-Options.html
Never heard it pronounced car!
Likewise I say char as "car".
I have gone over half of it, and I will start recommending it left and right.
> /* Computes double of a number. Works by tripling the number, and then subtracting to get back to double. /
static int Twice(int num) {
int result = num * 3;
result = result - num;
return(result);**