I
Ingo Menger
Note that s is not a const char*.
Right.
Neither is the string literal.
That's the real failure, IMHO, since it certainly *is* a pointer to
characters that must not be altered via this pointer. Too bad one
learns that at runtime only, when the compiler already knew it.
The sheer number of people asking the very same question as the OP is
another hint that this kind of half-hearted support for const is at
least questionable.
If the string literal _was_ a const char*, the warning should come on
the initialization rather than the function call.
This would indeed be THE RIGHT THING (TM) to do.