strcpy wars, jeez! A proposed resolution.
Henry Spencer
henry at utzoo.uucp
Sun Apr 3 11:37:33 AEST 1988
> ... The prototype would change ... to
> char *strcpy(char *s1, char *s2)
> since, as you pointed out, both s1 and s2 are possibly aliased and the
> string pointed to by s2 is no longer guaranteed to be constant...
The latter is quite irrelevant; const on a pointer does not mean that the
thing pointed to is constant, just that attempts to modify it through that
pointer are illegal. (If this double meaning of const strikes you as less
than ideal, you're in good company.)
--
"Noalias must go. This is | Henry Spencer @ U of Toronto Zoology
non-negotiable." --DMR | {allegra,ihnp4,decvax,utai}!utzoo!henry
More information about the Comp.lang.c
mailing list