comp.lang.ada
 help / color / mirror / Atom feed
From: "G.B." <bauhaus@notmyhomepage.invalid>
Subject: Re: Extra information in the message string of exceptions.
Date: Sat, 29 Oct 2022 10:59:53 +0200	[thread overview]
Message-ID: <tjiq29$3dqso$1@dont-email.me> (raw)
In-Reply-To: <tji5i6$3bjhn$3@dont-email.me>

On 29.10.22 05:10, Rod Kay wrote:

>     I'm a little surprised that the compiler shows a warning rather than an error but I suppose there must be some reason for that.


Formal language reasons aside, a program's author may have wanted
the program to raise an exception. (For example: "There is
a TODO here, so make sure the program never runs past this point.
Assign out of range.")

GNAT just emits a warning for the following program, albeit not the
same warning.
BTW, what would SPARK do here?

procedure Excpt
is
     Works_As_Expected: exception;

     procedure Test is
     begin
         if 1 = 1 then
             raise Works_As_Expected;
         else
             raise Program_Error;
         end if;
     end Test;
begin
     Test;
end Excpt;

  parent reply	other threads:[~2022-10-29  8:59 UTC|newest]

Thread overview: 31+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-06-06 12:59 Extra information in the message string of exceptions Rod Kay
2022-06-06 13:40 ` Fabien Chouteau
2022-06-06 18:40   ` G.B.
2022-06-06 19:24     ` Dmitry A. Kazakov
2022-06-07 11:26   ` Rod Kay
2022-06-07 15:55   ` Fabien Chouteau
2022-06-07 16:41     ` Anh Vo
2022-06-08  7:31     ` Jerry
2022-06-08  8:04       ` Dmitry A. Kazakov
2022-06-09  2:39         ` Jerry
2022-06-08  9:08       ` Dmitry A. Kazakov
2022-10-27 11:56         ` Rod Kay
2022-10-29  0:35           ` Jerry
2022-10-29  3:10             ` Rod Kay
2022-10-29  6:30               ` Gautier write-only address
2022-10-29  8:59               ` G.B. [this message]
2022-11-01  0:05             ` Jerry
2022-06-06 14:31 ` Gautier write-only address
2022-06-07  2:33   ` Randy Brukardt
2022-06-07 11:47     ` Rod Kay
2022-06-07 11:29   ` Rod Kay
2022-06-06 20:14 ` Luke A. Guest
2022-06-07 11:51   ` Rod Kay
2022-06-07 21:06     ` Luke A. Guest
2022-06-06 20:49 ` DrPi
2022-06-06 23:17   ` Jerry
2022-06-07  1:53     ` Gautier write-only address
2022-06-07  2:35       ` Randy Brukardt
2022-06-07  8:07       ` Simon Wright
2022-06-08  7:14       ` Jerry
2022-06-09  8:21 ` Robin Vowels
replies disabled

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