News for hackers. Stuff that matters.
Re:My personal C coding style as of late 2023 by epcoa on Sunday October 08, 2023 @11:22PM (#37816608)
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.

There are no comments on this comment yet.