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-Thread: 103376,a88e582de42cdc9b X-Google-Attributes: gid103376,public,usenet X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news1.google.com!news1.google.com!border1.nntp.dca.giganews.com!border2.nntp.dca.giganews.com!nntp.giganews.com!cyclone1.gnilink.net!spamkiller.gnilink.net!gnilink.net!trnddc04.POSTED!c44d10bf!not-for-mail From: "Bob Klungle" Newsgroups: comp.lang.ada References: <0_mdna0iHpIsCifaRVnzvQA@telenor.com><47ba9867$0$21892$4f793bc4@news.tdc.fi><3a281192-2744-4110-9fc1-90c155c9436b@d4g2000prg.googlegroups.com><48277611-402f-4622-be05-6edddf6dd56a@o10g2000hsf.googlegroups.com> <624tcvF21i3nvU1@mid.individual.net><2630d99b-1578-4d79-ac9c-64c00c203b77@e60g2000hsh.googlegroups.com> Subject: Re: Access type (mis)use (Was: Bug in Ada (SuSe 10.2) ?) X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2900.3138 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.3198 X-RFC2646: Format=Flowed; Original Message-ID: Date: Thu, 21 Feb 2008 19:40:34 GMT NNTP-Posting-Host: 71.177.102.116 X-Complaints-To: abuse@verizon.net X-Trace: trnddc04 1203622834 71.177.102.116 (Thu, 21 Feb 2008 14:40:34 EST) NNTP-Posting-Date: Thu, 21 Feb 2008 14:40:34 EST Xref: g2news1.google.com comp.lang.ada:19948 X-Original-Bytes: 2502 Date: 2008-02-21T19:40:34+00:00 List-Id: "Jacob Sparre Andersen" wrote in message news:ygefxvmv6ir.fsf_-_@hugsarin.dmusyd.edu... > billjones6789@yahoo.com writes: > >> What should this print? >> >> with Ada.Text_IO; >> procedure Dangling_Pointer is >> type Int_Access is access all integer; >> >> Save : Int_Access; >> >> type AirSpeed is record >> Altitude : aliased integer := 9; >> end record; >> >> type AoA (Rudder: access AirSpeed) is limited null record; >> >> function WoW (Slats: access AirSpeed) return Int_Access is >> begin >> return Slats.Altitude'Access; >> end; >> >> procedure Calculate is >> Fuel: aliased AirSpeed; >> Heading: AoA (Fuel'Access); >> begin >> Save := WoW (Heading.Rudder); > > I would expect the above line to give a compile time error. If it > doesn't: Why? > > Greetings, > > Jacob > -- > "Preserve wildlife, pickle a duck." For what it is worth, cygwin gnatmake 3.4.4 yields 9 11 cheers...bob