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-7-bit Path: g2news1.google.com!postnews.google.com!e41g2000hsc.googlegroups.com!not-for-mail From: billjones6789@yahoo.com Newsgroups: comp.lang.ada Subject: Re: Bug in Ada (SuSe 10.2) ? Date: Tue, 26 Feb 2008 08:46:11 -0800 (PST) Organization: http://groups.google.com Message-ID: <48a0a0c4-7b79-42dc-b541-7a68693bdd4c@e41g2000hsc.googlegroups.com> References: <0_mdna0iHpIsCifaRVnzvQA@telenor.com> <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: 66.126.103.122 Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-Trace: posting.google.com 1204044372 4714 127.0.0.1 (26 Feb 2008 16:46:12 GMT) X-Complaints-To: groups-abuse@google.com NNTP-Posting-Date: Tue, 26 Feb 2008 16:46:12 +0000 (UTC) Complaints-To: groups-abuse@google.com Injection-Info: e41g2000hsc.googlegroups.com; posting-host=66.126.103.122; posting-account=EwprVAoAAADupkeB7R-LUjsi4Ab2CUvf User-Agent: G2/1.0 X-HTTP-UserAgent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.7.12) Gecko/20050922 Fedora/1.0.7-1.1.fc3 Firefox/1.0.7,gzip(gfe),gzip(gfe) Xref: g2news1.google.com comp.lang.ada:20096 Date: 2008-02-26T08:46:11-08:00 List-Id: On Feb 25, 4:32 pm, "Randy Brukardt" wrote: > 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...) > ... > 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). If you are suggesting that the prevention of dangling pointers (into the stack) is simply non-normative flowery language intended to be ignored or forgotten, then I disagree. I think it is a fundamental language invariant that users should be able to rely on to prevent the worst kind of programming errors (scribbling on arbitrary memory). Paragraph 3 of 3.10.2, which _is_ normative, repeats the invariant: "The accessibility rules, which prevent dangling references ...". And the Ada 95 Rationale repeats it as well in Section 3.7, paragraph 3, which says: "An additional accessibility check is performed to ensure that the lifefime of the designated subprogram or object will not end before that of the access type, eliminating the possibility of dangling references." > 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. You are completely missing the point. The simple examples provided show that it is _not_ so easy to get a Program_Error where one is expected. > Anyway, I'm pretty sure this is getting wildly off-topic. To bring it back on topic, an unsuspecting Ada programmer will be quite surprised to see overflow checks and stack checks not performed by default in some cases, and will be equally surprised to see accessibility checks not performed by default in some cases. For overflow and stack checks, there is a rather simple solution involving specifying default flags in the project file. But for accessibility checks, I do not know of any similar solution.