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!news1.google.com!npeer01.iad.highwinds-media.com!news.highwinds-media.com!feed-me.highwinds-media.com!cyclone1.gnilink.net!gnilink.net!nx02.iad.newshosting.com!newshosting.com!newspeer.monmouth.com!newsswitch.lcs.mit.edu!nntp.TheWorld.com!not-for-mail From: Robert A Duff Newsgroups: comp.lang.ada Subject: Re: overriding in private part Date: Sun, 05 Oct 2008 16:08:16 -0400 Organization: The World Public Access UNIX, Brookline, MA Message-ID: References: <45b4a4cc-13f5-4175-9061-9c962e32d762@64g2000hsm.googlegroups.com> <47e26a8d-d104-46c5-b841-667f6e556792@w7g2000hsa.googlegroups.com> NNTP-Posting-Host: shell01.theworld.com Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: pcls4.std.com 1223237297 22574 192.74.137.71 (5 Oct 2008 20:08:17 GMT) X-Complaints-To: abuse@TheWorld.com NNTP-Posting-Date: Sun, 5 Oct 2008 20:08:17 +0000 (UTC) User-Agent: Gnus/5.1008 (Gnus v5.10.8) Emacs/21.3 (irix) Cancel-Lock: sha1:nb0f8Gcf4ab64d1x4N8YbcwYrYk= Xref: g2news1.google.com comp.lang.ada:2243 Date: 2008-10-05T16:08:16-04:00 List-Id: 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. > 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. But of course if you're worried about forgetting the warning switch, you should be equally worried about forgetting that pragma. Neither one seems like a big problem -- it's something you do once, when setting up your project-wide pragmas, or project-wide build scripts. Much more likely to forget "overriding" when declaring a procedure, which is something you do every day. Note that if you're writing code for several Ada compilers, you only need one of them to give the warning. - Bob