Path: utzoo!mnetor!uunet!husc6!hao!oddjob!gargoyle!ihnp4!homxb!mhuxt!m10ux!mnc From: mnc@m10ux.UUCP (Michael Condict) Newsgroups: comp.lang.c Subject: Re: (So-Called) ANSI C Message-ID: <453@m10ux.UUCP> Date: 22 Dec 87 21:17:33 GMT References: <4668@pyr.gatech.EDU> <3873@uw-june.UUCP> <6896@brl-smoke.ARPA> Organization: AT&T Bell Labs, Murray Hill Lines: 43 Summary: reason for noalias not a pragma In article <6896@brl-smoke.ARPA>, gwyn@brl-smoke.ARPA (Doug Gwyn ) writes: > In article <3873@uw-june.UUCP> pardo@uw-june.UUCP (David Keppel) writes: > >This is why I think pragmas are a better mechanism for doing things like > >``noalias'', etc. I'm now a little bothered that the debate over whether > >to have ``noalias'' rages on yet nobody has talked about leaving the > >language alone and using pragmas to get the optimizations... > > There are (at least) two reasons for this. > (1) X3J11 proposed "noalias". They did not propose a specific > pragma for this. > (2) A #pragma cannot, according to the rules, alter program > semantics. Therefore it cannot be used to obtain the kind of > optimization that "noalias" permits, because that IS > semantically visible. With all due respect, I think Doug is off-base one this one. Addressing his points in turn: (1) This is begging the question, which might just as well have been stated: Why did X3J11 propose a new keyword instead of a pragma? (2) This is not an unavoidable problem with a "noalias" pragma. All that needs to be done is to say that the noalias pragma may only appear at those places in the program where it is true (i.e., the variable truly has only one handle). Then it does not alter the meaning of any correct C program. (Of course, one would not require that the compiler or run-time system detect this error.) Surely it is considered okay to have pragmas whose use is restricted in this or other ways? Or must every pragma be allowed to occur everywhere? If so, why? I strongly agree with Dennis Ritchie and others that adding keywords for the sole purpose of optimization is a very big mistake, especially at this late stage in the standardization process. Isn't the committee aware that each new reserved word may invalidate a substantial number of existing C programs that previously used that word as a variable? I though one of the prime directives was to cause the maximum possible number of existing (correct) C programs to conform to the standard. This goal REQUIRES using a pragma instead of a new reserved word wherever possible. -- Michael Condict {ihnp4|vax135|cuae2}!m10ux!mnc AT&T Bell Labs (201)582-5911 MH 3B-416 Murray Hill, NJ