"Kevin Grittner" <Kevin.Grittner@wicourts.gov> writes:
> Tom mentioned the strchr() function, which does do that. I don't
> actually find that surprising given my understanding of the
> semantics. That means that the function is promising not to modify
> the character array, but is not asserting that it knows the
> character array to be immutable. Makes sense to me. It's up to the
> caller to assign it to a "const char *" if it knows it passed in an
> immutable object.
The problem with it of course is that mistaken use could have the
effect of casting-away-const, which is exactly what we hoped to prevent.
Still, there may not be a better solution.
regards, tom lane