Path: utzoo!mnetor!uunet!husc6!cmcl2!brl-adm!brl-smoke!gwyn From: gwyn@brl-smoke.ARPA (Doug Gwyn ) Newsgroups: comp.lang.c Subject: Re: noalias, again Message-ID: <7506@brl-smoke.ARPA> Date: 21 Mar 88 11:35:50 GMT References: <7712@apple.Apple.Com> <7485@brl-smoke.ARPA> <10731@mimsy.UUCP> Reply-To: gwyn@brl.arpa (Doug Gwyn (VLD/VMB) ) Organization: Ballistic Research Lab (BRL), APG, MD. Lines: 16 In article <10731@mimsy.UUCP> chris@mimsy.UUCP (Chris Torek) writes: > /* remove leading junk (n < strlen(buf)) */ > (void) strcpy(buf, buf + n); >You must understand `noalias' to know why this has become illegal This usage was never a good idea, because a valid implementation of strcpy() would be to copy right-to-left rather than left-to-right through the source string, in which case the first n bytes of the result would not be what you expect. All that the addition of noalias to the official interface spec does is to warn you about this fact (of which you were apparently unaware). Thus your example helps make a case for noalias being in the spec! On the other hand, strcpy() between NON-OVERLAPPING portions of an array is supposed to be valid, so if the noalias wording doesn't agree with that, we'll have to fix it.