Path: utzoo!utgpu!water!watmath!clyde!att!osu-cis!killer!ames!mailrus!uflorida!novavax!proxftl!bill From: bill@proxftl.UUCP (T. William Wells) Newsgroups: comp.lang.c Subject: Re: #pragma does only half the job (was Re: Pragma and noalias) Keywords: Pragma Message-ID: <448@proxftl.UUCP> Date: 11 Jul 88 06:55:12 GMT References: <381@proxftl.UUCP> <8176@brl-smoke.ARPA> <423@proxftl.UUCP> <5240@ihlpf.ATT.COM> Organization: Proximity Technology, Ft. Lauderdale Lines: 51 In article <5240@ihlpf.ATT.COM>, nevin1@ihlpf.ATT.COM (00704a-Liber) writes: > In article <423@proxftl.UUCP> bill@proxftl.UUCP (T. William Wells) writes: > > >This would mean that writing strcpy as: > > > > char * > > strcpy(p1, p2) > > char *p1; > > char *p2; > > #pragma noalias p1[],p2[]; > > { > > ... > > } > > > >is ok, because, given that the assertion (that p1 and p2 are not > >aliased) is true, should the compiler make that assumption, the > >program will be still correct. > > But, as Dennis Ritchie pointed out in his 'noalias must go' declaration (BTW, > I kept a copy of it and I have been emailing it to all those who have > requested it): > [something from dmr, omitted] > Specfically, in your example, strcpy() returns an ALIAS to p1, which by > the definition of noalias is not allowed. Upon reading your response my first idea was to flame you for not having read my posting carefully. Instead, I get to flame myself. (snap, crackle, whoosh: OK, you idiot, why didn't you say that your #pragma was different from the proposed noalias keyword? :-) Anyway, here is what I should have inserted into my posting: "I might define a #pragma noalias declarator_list; which asserts that, should an expression of a form equivalent to one of these declarators be used to modify an object, that object will not be referencable by means of an expression of a form equivalent to any of the other declarators." In the given example, the only thing that the compiler may assume is that, since p1[] is going to be modified, p2[] will not be. I am aware that my example #pragma is a little rough around the edges, but since I only needed it as an example, I am not going to elaborate on how it might be fixed up.