IIRC, this statement is not true. String literals as defined
in the C Standard are not defined as constant.
String literals are defined by the C++ standard as having type
char const[n+1], where n is the number of characters in the
literal. There is a hacky implicit conversion, however, to
allow using them to initialize a char*. In C (not really
relevant here, of course), they are defined as having type
char[n+1], but as being non-modifiable. Again, the type is
compromized to allow them to be used to initialize a char*.
The reason for the compromize is historical: C didn't always
have const, and before const existed, `char* s = "literal";'
was, of course, a common idiom. Naturally, no one would write
this in new code, today, but there is a strong desire to not
break existing code.
Yet, modifying them leads to undefined behavior. This is what
I recollect from C89 (I have to admit that it's been quite
some time, so I may be wrong).
That's correct for C90.
Most of the Unix compilers place string literals in a read
only region, so modifying them gets a segmention violation
there.
Most Unix compilers I know have an option so you can choose
whether they are really modifiable or not. In K&R C, they were
explicitly modifiable, programs were written for Unix which
depended on it, and compiler vendors don't want to break code,
even if the code is shit.