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,12c1e4936587932e X-Google-Attributes: gid103376,domainid0,public,usenet X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news1.google.com!news4.google.com!proxad.net!feeder1-2.proxad.net!news.in2p3.fr!in2p3.fr!news.ecp.fr!news.jacob-sparre.dk!pnx.dk!not-for-mail From: "Randy Brukardt" Newsgroups: comp.lang.ada Subject: Re: overriding in private part Date: Mon, 6 Oct 2008 18:39:24 -0500 Organization: Jacob's private Usenet server Message-ID: References: <45b4a4cc-13f5-4175-9061-9c962e32d762@64g2000hsm.googlegroups.com> <47e26a8d-d104-46c5-b841-667f6e556792@w7g2000hsa.googlegroups.com> NNTP-Posting-Host: static-69-95-181-76.mad.choiceone.net X-Trace: jacob-sparre.dk 1223336386 4029 69.95.181.76 (6 Oct 2008 23:39:46 GMT) X-Complaints-To: news@jacob-sparre.dk NNTP-Posting-Date: Mon, 6 Oct 2008 23:39:46 +0000 (UTC) X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2900.5512 X-RFC2646: Format=Flowed; Original X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.5579 Xref: g2news1.google.com comp.lang.ada:2258 Date: 2008-10-06T18:39:24-05:00 List-Id: "Robert A Duff" wrote in message news:wccfxna24b3.fsf@shell01.TheWorld.com... > stefan-lucks@see-the.signature writes: > >> On Sat, 4 Oct 2008, Robert A Duff wrote: >> >>> If you use a compiler that warns on missing "overriding", then you don't >>> need to say "not overriding", because that's the default -- any >>> subprogram that doesn't say "overriding" is not overriding. >>> Saying "not overriding" is just noise. >> >> "If you use a compiler that [does the right thing]" (or rather, if you >> use >> that compiler and the right set compiler switches) that works more or >> less >> fine. Except that you get only a warning on something that ought to be >> treated as an error. (Yes, I know that gnat has a switch to treat >> warnings >> as errors.) > > Shrug. To me, warnings and errors are pretty-much the same. > At AdaCore, we compile everything in warnings-as-errors mode. > Not always, but we have procedures in place that ensure no > Ada code can escape into customer's hands with warnings. OK, I guess, but I disagree (and agree with Stefan); errors required by the language are always more powerful than something done by a specific implementation (unless you can be sure that you are never going to use another implementation!). Besides, I don't see how your warning would work with Ada 95 code (such as Claw). There's little value to having warnings in such code (it isn't yours anyway), but you still would want the errors in your own code. So it seems likely that you would have to turn the warning off in large amounts of code; that is going to make it more likely that it is also omitted in code where you want it to be checked. >> But a compiler-agnostic way to enforce the proper behaviour (overriding >> indicators for all the subprograms which actually override another >> subprogram) would be preferable, IMHO. I wish there was an Ada 05 >> "pragma Overriding_Indicators_For_All_Oriding_Subprograms" >> or the like. Or did I overlook something like that in the standard? > > I don't think you overlooked anything. I agree portability is nice, so > it would nice to have a portable way to say this. Pragma > Require_Overriding_Indicators might be a reaonable name. We couldn't figure out how such a pragma would work with generics. That's the main reason this is a three-state switch: "overriding", "not overriding", and nothing (which is essentially "don't care"). This may be a case where "perfect" prevented "good enough" -- I surely wanted such a pragma, but it would have to have enough holes that it wasn't clear that it was worth anything. Randy.