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,FREEMAIL_FROM autolearn=ham autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,1e4bb63e08046e1a X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2002-10-30 11:44:12 PST Path: archiver1.google.com!postnews1.google.com!not-for-mail From: prichtmyer@yahoo.com (Peter Richtmyer) Newsgroups: comp.lang.ada Subject: Re: In case statment? (was Re: is exception when others => null; smart?) Date: 30 Oct 2002 11:44:12 -0800 Organization: http://groups.google.com/ Message-ID: <1b585154.0210301144.4d5fec5f@posting.google.com> References: <3DB8204B.2080804@attbi.com> <3DB89B83.2060609@acm.org> <1b585154.0210291023.70af4929@posting.google.com> NNTP-Posting-Host: 164.223.72.6 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 8bit X-Trace: posting.google.com 1036007052 17240 127.0.0.1 (30 Oct 2002 19:44:12 GMT) X-Complaints-To: groups-abuse@google.com NNTP-Posting-Date: 30 Oct 2002 19:44:12 GMT Xref: archiver1.google.com comp.lang.ada:30238 Date: 2002-10-30T19:44:12+00:00 List-Id: Lutz Donnerhacke wrote in message news:... > * Peter Richtmyer wrote: > > As the following example illustrates, it really depends upon > > the compiler too. A "bad" value is handled differently as > > shown: > > ----------------------------------------------------------- > > with system; > > with text_io; > > procedure test is > > > > a : character := character'val(2#11111111#); > > for a'size use 8; > > b : boolean; > > for b'address use a'address; > > for b'size use 8; > > Don't map variable b without pragma Import(Ada, b); > This prevents initialising of address space, which--in this case--renders > your example unusable. The type boolean does not have a default value, so the program behaves the same (on Gnat) with or wothout the Pragma. You can see this by adding this line after "begin": text_io.put_line ("a'pos is " & integer'image (character'pos(a))); and you should see: a'pos is 255 Mapping the 'b' variable over 'a' does not affect the value of 'a' here. Peter