3 ms·
That's still ultimately up to the language - if it does say that constness is always legal to cast away, then compilers can't put const stuff into rodata. Ther
by int_19h 4y ago
That's still ultimately up to the language - if it does say that constness is always legal to cast away, then compilers can't put const stuff into rodata.
There's also stuff that obviously can't end up in rodata, such as const locals that are initialized from arguments or I/O. Sometimes people assume that this means that casting away constness is legal in such cases.