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.3 required=5.0 tests=BAYES_00,INVALID_MSGID autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,dabd2d2ffbcf1daa X-Google-Attributes: gid103376,public From: tmoran@bix.com Subject: Re: Exiting from a function or procedure Date: 2000/04/23 Message-ID: #1/1 X-Deja-AN: 614741219 References: <8duvlj$opk$1@nnrp1.deja.com> X-Complaints-To: abuse@pacbell.net X-Trace: news.pacbell.net 956523867 206.170.2.10 (Sun, 23 Apr 2000 14:04:27 PDT) Organization: SBC Internet Services NNTP-Posting-Date: Sun, 23 Apr 2000 14:04:27 PDT Newsgroups: comp.lang.ada Date: 2000-04-23T00:00:00+00:00 List-Id: >The trouble with leaving warnings in your code is that you can >easily get into the habit of ignoring warnings, and we see many Agreed. >Of course the pragmas Warnings (Off) and No_Return are GNAT >specific, but there are several points to be made there: In this case, I could dispense with the Gnat warning by using pragma Warnings(Off) or No_Return, but instead I'd just get new warnings, about unrecognized pragmas, from other compilers. So in either case warnings will be raised, at least until all (or at least most) Ada compilers implement one or both of those pragmas. In this specific case, rewriting usually removes the warning, though it may confuse the maintenance programmer who worries "what value is returned when things are not OK?". It's also subject to the previously noted problem "what happens if there's a bug and Log_And_Raise_Error actually *does* return?" if not OK then Log_And_Raise_Error; end if; return some_value; end some_function; > GNAT tends to be pretty aggressive in looking for opportunities to > generate warnings. Note that some compilers don't even ... A classic tradeoff in this case between Type 1 and Type 2 error probabilities.