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,d17561d7e5eba62c X-Google-Attributes: gid103376,public From: Simon Wright Subject: Re: An alternative to Unchecked Conversion Date: 1999/12/17 Message-ID: #1/1 X-Deja-AN: 562358010 X-NNTP-Posting-Host: pogner.demon.co.uk:158.152.70.98 References: <38596575_4@news1.prserv.net> <3859701a@rsl2.rslnet.net> X-Trace: news.demon.co.uk 945535817 nnrp-08:22750 NO-IDENT pogner.demon.co.uk:158.152.70.98 Organization: At Home Newsgroups: comp.lang.ada X-Complaints-To: abuse@demon.net Date: 1999-12-17T00:00:00+00:00 List-Id: Brian Orpin writes: > Well the Tartan Ada (83) compiler we are using doesn't allow us to use > address mapping as it requires all address statements to be static. > > With SYSTEM; > Use SYSTEM; > > Procedure TEST Is > Type TEST_TYPE Is New INTEGER; > For TEST_TYPE'Size Use 32; > > X : TEST_TYPE; > Y : TEST_TYPE; > For X Use At Y'Address; > > Begin > > X := 1; > > End TEST; > > 9| Y : TEST_TYPE; > test.ada:10:1: > 10| For X Use At Y'Address; > ^1 > *** 1 Error 3271: A static expression is expected here (RM83 4.9) I was expecting GNAT to complain similarly about this but neither 3.11p nor 3.12a2 does, so clearly I haven't understood. Under similar circumstances, the typical solution is like X : TEST_TYPE; Y : TEST_TYPE; Y_Address : constant Address := Y'Address; For X'Address Use Y_Address; (Brian, are you still using 83? because "For X Use At Y'Address" is an 83-ism)