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.3 required=5.0 tests=BAYES_00,INVALID_MSGID autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,e723b158fb4ad12e X-Google-Attributes: gid103376,public From: Simon Wright Subject: Re: Initialized global data Date: 1998/05/09 Message-ID: #1/1 X-Deja-AN: 351786463 X-NNTP-Posting-Host: pogner.demon.co.uk:158.152.70.98 References: X-Complaints-To: abuse@demon.net X-Trace: news.demon.co.uk 894743281 nnrp-08:6263 NO-IDENT pogner.demon.co.uk:158.152.70.98 Organization: At Home Newsgroups: comp.lang.ada Date: 1998-05-09T00:00:00+00:00 List-Id: stt@houdini.camb.inmet.com (Tucker Taft) writes: > Simon Wright (simon@pogner.demon.co.uk) wrote: > > : nobody@REPLAY.COM (Anonymous) writes: > : [...] > : > Or you can use an uninitialized "variable" (that doesn't) at a specified > : > address: > : > > : > X : T; > : > for X'Address use A; -- Ada 83: "for X use at A;" > > : I'm not sure of chapter-and-verse, but I believe that a compiler is > : allowed to initialize X here under some circumstances; which wouldn't > : be what you wanted! > > A "pragma Import(Ada, X);" would prevent initialization. I saw (searching the AARM for 'implicit initialization' and 'default initialization') that a pragma Import would do the trick but I must say it never occured to me to do this! So, to get it straight, if I have the code below with System; with System.Storage_Elements; package Foo is Vme_Address : constant System.Address := System.Storage_Elements.To_Address (16#1_000_000#); Vme_Items : array (0 .. 16#1_000#) of Integer; for Vme_Items'Address use Vme_Address; pragma Import (Ada, Vme_Items); end Foo; and I want to be quite sure that Vme_Items isn't initialized, the Ada idiom is to include the pragma Import line?