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-Thread: 103376,a88e582de42cdc9b X-Google-Attributes: gid103376,public,usenet X-Google-Language: ENGLISH,ASCII Path: g2news1.google.com!postnews.google.com!s19g2000prg.googlegroups.com!not-for-mail From: billjones6789@yahoo.com Newsgroups: comp.lang.ada Subject: Re: Bug in Ada (SuSe 10.2) ? Date: Sat, 23 Feb 2008 02:36:47 -0800 (PST) Organization: http://groups.google.com Message-ID: 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> <69019a65-736e-48ee-bd9f-4c29cd7fc88f@72g2000hsu.googlegroups.com> NNTP-Posting-Host: 75.51.80.135 Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable X-Trace: posting.google.com 1203763007 7469 127.0.0.1 (23 Feb 2008 10:36:47 GMT) X-Complaints-To: groups-abuse@google.com NNTP-Posting-Date: Sat, 23 Feb 2008 10:36:47 +0000 (UTC) Complaints-To: groups-abuse@google.com Injection-Info: s19g2000prg.googlegroups.com; posting-host=75.51.80.135; posting-account=EwprVAoAAADupkeB7R-LUjsi4Ab2CUvf User-Agent: G2/1.0 X-HTTP-UserAgent: Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1; .NET CLR 1.0.3705; .NET CLR 1.1.4322; Media Center PC 4.0),gzip(gfe),gzip(gfe) Xref: g2news1.google.com comp.lang.ada:20019 Date: 2008-02-23T02:36:47-08:00 List-Id: On Feb 22, 11:52=A0am, "Randy Brukardt" wrote: > These aren't "dangling pointer" checks (which would occur on the > dereference). If you wanted to talk about them informally, I'd call them > "lifetime" checks, but it is best to call them by their real name (which y= ou > finally did above). I thought you were talking about something completely > different. Sorry to confuse you. Maybe my English is not so good. I was referring to this language-defined check by its high-level purpose rather than its low-level implementation model, the same way it is introduced in RM 3.10.2 paragraph 1, "The accessibility rules prevent dangling references ...". > Anyway, accessibility checks contain both a static and dynamic part, and i= t > is fairly difficult to write an interesting program that passes the static= > check and fails the dynamic check. I provided what I thought to be a rather simple example program that demonstrated the dynamic case. Do you mean to say that this example is fairly difficult to use in an interesting program? It did include an access discriminant, which may be confusing, but that can be easily removed, as follows: with Ada.Text_IO; procedure Dangling_Pointer2 is type Int_Access is access all integer; Save : Int_Access; type AirSpeed is record Altitude : aliased integer :=3D 9; end record; function WoW (Slats: access AirSpeed) return Int_Access is begin return Slats.Altitude'Access; end WoW; procedure Calculate is Heading : aliased AirSpeed; begin Save :=3D WoW (Heading'access); Ada.Text_IO.Put_Line (integer'image(Save.all)); end Calculate; procedure Mess_with_stack is Dummy: array(1..10) of integer :=3D (others =3D> 17); begin null; end Mess_with_stack; begin Calculate; Mess_with_stack; Ada.Text_IO.Put_Line (integer'image(Save.all)); end Dangling_Pointer2;