comp.lang.ada
 help / color / mirror / Atom feed
From: tmoran@bix.com
Subject: Re: Exiting from a function or procedure
Date: 2000/04/23
Date: 2000-04-23T00:00:00+00:00	[thread overview]
Message-ID: <vzJM4.1253$t25.356170@news.pacbell.net> (raw)
In-Reply-To: 8duvlj$opk$1@nnrp1.deja.com

>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.




  reply	other threads:[~2000-04-23  0:00 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2000-04-21  0:00 Exiting from a function or procedure Andres Tarallo
2000-04-21  0:00 ` Robert A Duff
2000-04-21  0:00 ` tmoran
2000-04-21  0:00   ` Andres Tarallo
2000-04-22  0:00     ` Robert Dewar
2000-04-22  0:00       ` Ken Garlington
2000-04-22  0:00       ` tmoran
2000-04-22  0:00         ` Ray Blaak
2000-04-22  0:00           ` David Starner
2000-04-23  0:00         ` Robert Dewar
2000-04-23  0:00           ` tmoran [this message]
2000-04-24  0:00             ` Robert Dewar
2000-04-24  0:00             ` Robert Dewar
2000-04-24  0:00               ` tmoran
2000-04-24  0:00                 ` Robert Dewar
2000-04-22  0:00       ` Pablo Moisset
2000-04-23  0:00         ` Robert Dewar
2000-04-24  0:00       ` Scott Ingram
2000-04-22  0:00   ` Robert Dewar
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox