4 ms·
At runtime, yes. But I want to know about errors like this at compile time.
by zabzonk 2y ago
At runtime, yes. But I want to know about errors like this at compile time.
- jcalvinowens 2y agoThat's not the point though. The point is that it's very unlikely any C written in the past 20 years relies on the ability to modify string literals.
- ryandrake 2y agoNot only that, but there are no valid C programs written ever, which rely on the ability to modify string literals. Doing so is undefined behavior, so the program is not valid. It may happen to work on some random platform, but it's still undefined.