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!news4.google.com!feeder1-2.proxad.net!proxad.net!feeder1-1.proxad.net!club-internet.fr!feedme-small.clubint.net!nuzba.szn.dk!news.jacob-sparre.dk!pnx.dk!not-for-mail From: "Randy Brukardt" Newsgroups: comp.lang.ada Subject: Re: Bug in Ada (SuSe 10.2) ? Date: Mon, 25 Feb 2008 18:32:54 -0600 Organization: Jacob's private Usenet server 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: static-69-95-181-76.mad.choiceone.net X-Trace: jacob-sparre.dk 1203986263 21778 69.95.181.76 (26 Feb 2008 00:37:43 GMT) X-Complaints-To: news@jacob-sparre.dk NNTP-Posting-Date: Tue, 26 Feb 2008 00:37:43 +0000 (UTC) X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2800.1914 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1914 Xref: g2news1.google.com comp.lang.ada:20072 Date: 2008-02-25T18:32:54-06:00 List-Id: wrote in message news:d8a465d3-9eae-480b-954f-93236e3a6203@s19g2000prg.googlegroups.com... On Feb 22, 11:52 am, "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 you >> 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 ...". I spend so much time in the language-lawyer cave (which requires only formal terminology) that I can get confused by informal terminology -- especially that which is not used in the standard. (Yes, I realize you found a mention of it in a non-normative introduction paragraph, but of course I hardly ever read those...) >> Anyway, accessibility checks contain both a static and dynamic part, and it >> 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? I've completely forgotten your original point (or mine, for that matter), so I'm probably babbling at this point. You are using anonymous access parameters to achieve the effect. You are quite correct that this is easy to do. That is in fact the problem: it is easy to get a Program_Error from passing the "wrong" thing to a subprogram that has an anonymous access parameter. Moreover, there is no way to indicate in the specification what is required. Contrast this to parameters that will be used as array indexes -- the specification ought to include the appropriate range, in which case any check will take place at the call site (and the error will be immediately obvious). On top of that, the use of access parameters (rather than "in" or "in out") clutters up the call site: both with a 'access and with "aliased" declarations. Plus, there is a substantial runtime overhead for them compared to named access types (where the checks are mainly static). Thus, I believe that they should be avoided if at all possible. (I admit that there are a few cases where they can't be avoided.) Indeed, a good ADT should not contain the keyword "access" anywhere in the visible part - the memory management of the top-level objects should be left to the client. Net-net I tend to forget about the accessibility checks on anonymous access parameters, because if you encounter them you probably are doing something bad (using anonymous access parameters). Of course, all of this is personal stylistic preferences; it is legal within the language. Anyway, I'm pretty sure this is getting wildly off-topic. Randy.