Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!utgpu!water!watnot!watmath!clyde!rutgers!ames!cit-vax!news From: news@cit-vax.UUCP Newsgroups: comp.lang.c++ Subject: Re: ANSI C & C++ idea Message-ID: <1857@cit-vax.Caltech.Edu> Date: Wed, 25-Feb-87 01:34:38 EST Article-I.D.: cit-vax.1857 Posted: Wed Feb 25 01:34:38 1987 Date-Received: Fri, 27-Feb-87 06:01:22 EST References: <17516@ucbvax.BERKELEY.EDU> Reply-To: jon@oddhack.UUCP (Jon Leech) Organization: California Institute of Technology Lines: 27 Organization : California Institute of Technology Keywords: ANSI, C, C++, idea From: jon@oddhack.Caltech.Edu (Jon Leech) Path: oddhack!jon In article <17516@ucbvax.BERKELEY.EDU> serge@ucbvax.BERKELEY.EDU (serge) writes: >[] > I would like to propose the following notation (valid only in function >argument declarations/definitions) > > void f(return Type *t) > >to mean that f() will only write the value pointed to by t, and not read it. What's your motivation for doing this? I.e. what kind of optimizations can a compiler make based solely on knowing that a variable is 'write-only'? One difference I see from 'const' is that the 'const' attribute may actually be enforced by the hardware as opposed to being a semantic abstraction. Perhaps MMUs that enforce write-only memory exist (the VAX doesn't seem to based on a quick perusal of the architecture handbook), but what do you use it for? -- Jon Leech (jon@csvax.caltech.edu || ...seismo!cit-vax!jon) Caltech Computer Science Graphics Group __@/