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,ea5071f634c2ea8b X-Google-NewGroupId: yes X-Google-Attributes: gida07f3367d7,domainid0,public,usenet X-Google-Language: ENGLISH,ASCII-7-bit Received: by 10.68.39.100 with SMTP id o4mr997643pbk.0.1321995835526; Tue, 22 Nov 2011 13:03:55 -0800 (PST) MIME-Version: 1.0 Path: lh20ni6581pbb.0!nntp.google.com!news1.google.com!volia.net!news2.volia.net!feed-A.news.volia.net!news.musoftware.de!wum.musoftware.de!news.tornevall.net!news.jacob-sparre.dk!pnx.dk!jacob-sparre.dk!ada-dk.org!.POSTED!not-for-mail From: "Randy Brukardt" Newsgroups: comp.lang.ada Subject: Re: Generic-Package Elaboration Question / Possible GNAT Bug. Date: Tue, 22 Nov 2011 15:03:52 -0600 Organization: Jacob Sparre Andersen Research & Innovation Message-ID: References: <7bf9bc32-850a-40c6-9ae2-5254fe220533@f29g2000yqa.googlegroups.com> <4295dc09-43de-4557-a095-fc108359f27f@y42g2000yqh.googlegroups.com> <3snehoqgs8ia$.1nobjem6g6hx6$.dlg@40tude.net> <128rdz2581345$.c4td19l7qp9z$.dlg@40tude.net> <16ipwvpdavifr$.17bxf7if7f6kh$.dlg@40tude.net> <4ecb78b1$0$6643$9b4e6d93@newsspool2.arcor-online.net> <1iofgbqznsviu$.phvidtvxlyj4$.dlg@40tude.net> <4ecbb96e$0$6581$9b4e6d93@newsspool3.arcor-online.net> <4ecbdfdb$0$6629$9b4e6d93@newsspool2.arcor-online.net> <12hfiflyf7pr5$.l3pkpgoid8xt$.dlg@40tude.net> NNTP-Posting-Host: static-69-95-181-76.mad.choiceone.net X-Trace: munin.nbi.dk 1321995834 7673 69.95.181.76 (22 Nov 2011 21:03:54 GMT) X-Complaints-To: news@jacob-sparre.dk NNTP-Posting-Date: Tue, 22 Nov 2011 21:03:54 +0000 (UTC) X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2900.5931 X-RFC2646: Format=Flowed; Original X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.6157 Xref: news1.google.com comp.lang.ada:19042 Date: 2011-11-22T15:03:52-06:00 List-Id: "Dmitry A. Kazakov" wrote in message news:12hfiflyf7pr5$.l3pkpgoid8xt$.dlg@40tude.net... > I my experience at least 40% of my debugging > efforts in Ada 95 was spent on catching accessibility checks faults. Ada > 2005 improved that greatly. To me this is a vivid example why dynamic > checks are evil. It's not "dynamic checks" that are evil, it is checking the uncheckable that is evil. 95% of accessibility check failures (static or dynamic) have no correlation to any error, so they are just crying wolf. "Checks" that don't prevent errors are evil, period -- it doesn't matter how they are checked. Note that I no longer even try to deal with accessibility checks; I use 'Unchecked_Access (only). Indeed, I've only found one single instance in my code (since Ada 95, about 15 years now) where I could actually use 'Access without error. In all other cases, my code either needs '[Unchecked_]Access for some short-lived thing (like a call to a C API) which has long-lived types (because it is declared at library-level), or I have to manage the lifetime issues myself (using controlled types). OTOH, dynamic checks like overflow checks and index checks are not evil, or maybe it would be better to say that they are the lesser of evils (getting the wrong answer silently is a greater evil). I don't see a practical alternative (proving a multiply does not overflow is difficult to do in general; I gave up trying in the Janus/Ada optimizer and simply try the operation to see what happens. It's not ideal, but it is the only practical solution). Randy.