From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,FREEMAIL_FROM autolearn=ham autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,a00006d3c4735d70 X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2004-01-06 16:00:00 PST Path: archiver1.google.com!news1.google.com!newsfeed.stanford.edu!headwall.stanford.edu!newshub.sdsu.edu!small1.nntp.aus1.giganews.com!border1.nntp.aus1.giganews.com!intern1.nntp.aus1.giganews.com!nntp.giganews.com!nntp.comcast.com!news.comcast.com.POSTED!not-for-mail NNTP-Posting-Date: Tue, 06 Jan 2004 17:59:58 -0600 Date: Tue, 06 Jan 2004 18:59:57 -0500 From: "Robert I. Eachus" User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.4) Gecko/20030624 Netscape/7.1 (ax) X-Accept-Language: en-us, en MIME-Version: 1.0 Newsgroups: comp.lang.ada Subject: Re: Certified C compilers for safety-critical embedded systems References: In-Reply-To: Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit Message-ID: NNTP-Posting-Host: 24.34.214.193 X-Trace: sv3-DJhf9l69ftmEZoGzpZw4cIGhai6/w2ootNfIfsfF4a7UMOjdu+IgeVkpvtAHxZPLFPBMOHpeCytBkkt!YbixUWefOosoJY1fwHHOcE8Y9sCKMLTaqtoFULWfwzEppj5mJz5CsiY6Eas56w== X-Complaints-To: abuse@comcast.net X-DMCA-Complaints-To: dmca@comcast.net X-Abuse-and-DMCA-Info: Please be sure to forward a copy of ALL headers X-Abuse-and-DMCA-Info: Otherwise we will be unable to process your complaint properly X-Postfilter: 1.1 Xref: archiver1.google.com comp.lang.ada:4160 Date: 2004-01-06T18:59:57-05:00 List-Id: Alexandre E. Kopilovitch wrote: > So I don't think that that argument is bogus, it has a real controversy as its > ground. Exactly. Way back, going from Preliminary Ada to Ada 80, the decision was made to allow side-effects in functions, but not to allow parameters to be modified, using that name/view. The Rosen trick is just a different way to get a non-constant view of a global passed as a parameter. Notice that when the value passed is not a global variable (or a variable in an outer scope) the Rosen trick can be used, but it won't affect the caller's environment at all. If what is passed is really a constant (and stored in the code section) the Rosen trick will cause a protection violation. (Of course, assuming that your OS marks code as readable and executable but not writable.) If you really want to insure that a function doesn't modify its parameters, just pass expressions instead of names. -- Robert I. Eachus "The war on terror is a different kind of war, waged capture by capture, cell by cell, and victory by victory. Our security is assured by our perseverance and by our sure belief in the success of liberty." -- George W. Bush