Q: If you can't modify string literals, why aren't they defined as being arrays of const characters?
A: One reason is that so very much code contains lines like
char *p = "Hello, world!";which are not necessarily incorrect. These lines would suffer the diagnostic messages, but it's really any later attempt to modify what p points to which would be problems.
See also question 1.32.