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: 2004-01-06 05:33:37 PST Path: archiver1.google.com!news2.google.com!newsfeed2.dallas1.level3.net!news.level3.com!news-out.visi.com!petbe.visi.com!eusc.inter.net!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: Tue, 6 Jan 2004 13:33:36 +0000 (UTC) Organization: GMUGHDU Message-ID: References: <3fe00b82.90228601@News.CIS.DFN.DE> <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> <3ff9df16.30249104@News.CIS.DFN.DE> NNTP-Posting-Host: l1-hrz.uni-duisburg.de X-Trace: a1-hrz.uni-duisburg.de 1073396016 2860 134.91.1.34 (6 Jan 2004 13:33:36 GMT) X-Complaints-To: usenet@news.uni-duisburg.de NNTP-Posting-Date: Tue, 6 Jan 2004 13:33:36 +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:6823 comp.lang.ada:4141 Date: 2004-01-06T13:33:36+00:00 List-Id: In comp.arch.embedded Dave Hansen wrote: : On Wed, 31 Dec 2003 14:27:08 +0000 (UTC), Georg Bauhaus : wrote: : :>In comp.lang.ada Dave Hansen wrote: : : Note: I'm reading from comp.arch.embedded. Just so you know where I'm : coming from... Sorry. I need to adjust my reader software. : Is the "'access" tag (or whatever you call it) It's an attribute, like 'address, 'size, 'range, etc. : Is the "'access" tag (or whatever you call it) _required_ on the call : if a function is going to modify the parameter? I like it even better : if that's true. Yes, as Stephen has explained. Let me add that if you want a variable to be modifiably through some pointer you will have to say so. You declare the variable aliased (using the "aliased" keyword in the declaration), and point to it using 'access values. There is also an 'unchecked_access attribute which allows pointers to aliased local objects to be passed around. The intention is to remind the programmer/maintainer of the pointer validity check that cannot in general be done by the compiler as in the following example: type Reg16_Ptr is access all Interfaces.Unsigned_16; -- pointer to a 16 bit register function trig_reg return Reg16_Ptr is v: aliased Interfaces.Unsigned_16; -- 16 bits from the toaster's eject trigger, v is local to function pragma Import(Ada, v); -- do not initialise v for v'address use System.Storage_Elements.To_Address(16#A022#); -- hardware address begin return v'unchecked_access; -- points to local v which is really a register, not a value on the -- stack end trig_reg; -- Georg