3 ms·
const in C and C++ are an abomination. On a pointer they don’t tell the compiler to do shit, because they can’t. That I can agree with TFA. However I agree wit
by epcoa 3y ago
const in C and C++ are an abomination. On a pointer they don’t tell the compiler to do shit, because they can’t.
That I can agree with TFA. However I agree with the GP that dismissing it entirely is a little misplaced. It serves as a hint/documentation and I think the article undersells the value of rodata (not the pointer use of const which is basically shit).
I mean I have seen at least a few SIGSEGV/aborts due to attempted writes to ro memory. Also like, one of the few modern justifications for C, embedded, const still has important link time meaning.