3 ms·
In fact there are ways in C (e.g. `volatile`, though not all are portable…) to get closer to the raw integer pointers the OP seems to want… but the compiler is
by TazeTSchnitzel 6y ago
In fact there are ways in C (e.g. `volatile`, though not all are portable…) to get closer to the raw integer pointers the OP seems to want… but the compiler is forced to generate worse code if you try to use them. That's probably why they're not the default.
The OP's viewpoint, which seems to be a fairly popular one, seems to be something like “why can't C be as intuitive as it was in the 1970's, didn't it work fine then?” Well, it probably still does work if you're happy with the level of optimisation a 1970's C compiler would give you (-O0 maybe?), and that's a valid choice! But compilers didn't get stricter about undefined behaviour for nothing, it's key to making those “zero-cost abstractions” actually have near-zero cost.