|
Yes, but it is way too easy to cast the result into (char*), in order to fix the compilation error... So the programmer has to understand that it is really forbidden to modify that string.
C APIs don't hold hands, and they shouldn't need to. If a programmer adds an explicit cast from a non-mutable value to a mutable value, they should know what they're doing; the type annotation is there for a reason :-)