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: 103376,a691dc29968966aa X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2003-03-19 09:10:20 PST Path: archiver1.google.com!news1.google.com!newsfeed.stanford.edu!news-spur1.maxwell.syr.edu!news.maxwell.syr.edu!newsfeed.icl.net!newsfeed.fjserv.net!newsfeed.icl.net!newsfeed.fjserv.net!newsfeed.freenet.de!easynews.net!newsfeed3.easynews.net!newsfeed.vmunix.org!news-FFM2.ecrc.net!news.iks-jena.de!not-for-mail From: Lutz Donnerhacke Newsgroups: comp.lang.ada Subject: Re: pragma Import with 'Address clause Date: Wed, 19 Mar 2003 17:10:19 +0000 (UTC) Organization: IKS GmbH Jena Message-ID: References: NNTP-Posting-Host: taranis.iks-jena.de X-Trace: branwen.iks-jena.de 1048093819 28119 217.17.192.37 (19 Mar 2003 17:10:19 GMT) X-Complaints-To: usenet@iks-jena.de NNTP-Posting-Date: Wed, 19 Mar 2003 17:10:19 +0000 (UTC) User-Agent: slrn/0.9.7.4 (Linux) Xref: archiver1.google.com comp.lang.ada:35518 Date: 2003-03-19T17:10:19+00:00 List-Id: * Stephen Leake wrote: > Lutz Donnerhacke writes: >> A common technique to reinterpret data is: >> a : AT; >> [...] >> b : BT; >> for b'Address use a'Address; >> pragma Import(Ada, b); >> >> Is the "pragma Import" really necessary? Of course, the ARM says, that >> elaboration and definition of the imported object is externally defined. So >> they are omitted from the Ada code itself. >> >> Assume BT is a record without any default expressions. Does this mean, the >> pragma can be omitted from the source code? >> >> Background: Spark prohibits the use of Pragma Import on objects. > > I would hope Spark would prohibit the address clause as well! Spark does handle the 'Address clause much more carefully than Ada95. The following function is problematic in Spark for two reasons: - Calculating with external variables is undeterministic. - Imported variables might not conform the type restrictions. function get_b return BT is b : BT; for b'Address use xxx; begin return b+b; end get_b; > you are totally defeating the Ada type system! No.