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 autolearn=ham autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: f849b,b8d52151b7b306d2 X-Google-Attributes: gidf849b,public X-Google-Thread: 103376,a00006d3c4735d70 X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2003-12-31 06:27:09 PST Path: archiver1.google.com!news2.google.com!fu-berlin.de!cs.tu-berlin.de!uni-duisburg.de!not-for-mail From: Georg Bauhaus Newsgroups: comp.arch.embedded,comp.lang.ada Subject: Re: Certified C compilers for safety-critical embedded systems Date: Wed, 31 Dec 2003 14:27:08 +0000 (UTC) Organization: GMUGHDU Message-ID: References: <3fe00b82.90228601@News.CIS.DFN.DE> <5802069.JsgInS3tXa@linux1.krischik.com> <1072464162.325936@master.nyc.kbcfp.com> <1563361.SfB03k3vvC@linux1.krischik.com> <11LvOkBBXw7$EAJw@phaedsys.demon.co.uk> <3ff0687f.528387944@News.CIS.DFN.DE> <1086072.fFeiH4ICbz@linux1.krischik.com> <3ff18d4d.603356952@News.CIS.DFN.DE> <1731094.1f7Irsyk1h@linux1.krischik.com> <3ff1b8ef.614528516@News.CIS.DFN.DE> <3FF1E06D.A351CCB4@yahoo.com> <3ff20cc8.635997032@News.CIS.DFN.DE> NNTP-Posting-Host: l1-hrz.uni-duisburg.de X-Trace: a1-hrz.uni-duisburg.de 1072880828 20782 134.91.1.34 (31 Dec 2003 14:27:08 GMT) X-Complaints-To: usenet@news.uni-duisburg.de NNTP-Posting-Date: Wed, 31 Dec 2003 14:27:08 +0000 (UTC) User-Agent: tin/1.5.8-20010221 ("Blue Water") (UNIX) (HP-UX/B.11.00 (9000/800)) Xref: archiver1.google.com comp.arch.embedded:6440 comp.lang.ada:3986 Date: 2003-12-31T14:27:08+00:00 List-Id: In comp.lang.ada Dave Hansen wrote: : while ( nextkey(&key) ) process(key); : : Note the address operator at the call. It makes it obvious (at the : point the function is used) that nextkey modifies its parameter (or at : least it _could_). In Pascal, the only way to know that is to look at : the function definition. In C++, the parameter is likely to be a : reference, and have the same problem (IMHO) as Pascal. Ada solution that addresses both & and the while(1) issue: procedure p is function next_key (key_filled: access Character) return Boolean is separate; procedure process (the_key: in out Character) is separate; key: aliased Character; begin while next_key (key'access) loop process(key); end loop; end p; -- Georg