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=-0.9 required=5.0 tests=BAYES_00,FORGED_GMAIL_RCVD, FREEMAIL_FROM autolearn=no autolearn_force=no version=3.4.4 X-Google-Thread: 103376,a88e582de42cdc9b X-Google-Attributes: gid103376,public,usenet X-Google-Language: ENGLISH,ASCII Path: g2news1.google.com!postnews.google.com!72g2000hsu.googlegroups.com!not-for-mail From: Vadim Godunko Newsgroups: comp.lang.ada Subject: Re: Access type (mis)use (Was: Bug in Ada (SuSe 10.2) ?) Date: Thu, 21 Feb 2008 13:57:18 -0800 (PST) Organization: http://groups.google.com Message-ID: <6d007932-b0af-4f9f-8dc9-f88073edc26a@72g2000hsu.googlegroups.com> 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> NNTP-Posting-Host: 83.221.195.123 Mime-Version: 1.0 Content-Type: text/plain; charset=KOI8-R Content-Transfer-Encoding: quoted-printable X-Trace: posting.google.com 1203631039 17458 127.0.0.1 (21 Feb 2008 21:57:19 GMT) X-Complaints-To: groups-abuse@google.com NNTP-Posting-Date: Thu, 21 Feb 2008 21:57:19 +0000 (UTC) Complaints-To: groups-abuse@google.com Injection-Info: 72g2000hsu.googlegroups.com; posting-host=83.221.195.123; posting-account=niG3UgoAAAD7iQ3takWjEn_gw6D9X3ww User-Agent: G2/1.0 X-HTTP-UserAgent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.8.1.4) Gecko/20070601 SeaMonkey/1.1.2,gzip(gfe),gzip(gfe) Xref: g2news1.google.com comp.lang.ada:19953 Date: 2008-02-21T13:57:18-08:00 List-Id: On 21 =C6=C5=D7, 22:40, "Bob Klungle" wrote: > "Jacob Sparre Andersen" wrote in messagenews:ygefxvmv6ir.f= sf_-_@hugsarin.dmusyd.edu... > > > > > billjones6...@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 :=3D 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 :=3D WoW (Heading.Rudder); > > > I would expect the above line to give a compile time error. If it > > doesn't: Why? > > For what it is worth, cygwin gnatmake 3.4.4 yields > 9 > 11 > Where are no problem at this place. Program_Error must be raised inside the Wow subprogram. Actual accessibility level of the object passed in Slats is deeper when Int_Access type. So, this is not a leak in the standard this is just a bug in the concrete compiler.