TEAM-ADA Archives

Team Ada: Ada Programming Language Advocacy

TEAM-ADA@LISTSERV.ACM.ORG

Options: Use Classic View

Use Monospaced Font
Show Text Part by Default
Condense Mail Headers

Topic: [<< First] [< Prev] [Next >] [Last >>]

Print Reply
Content-Transfer-Encoding: 7bit
Sender: "Team Ada: Ada Advocacy Issues (83 & 95)" <[log in to unmask]>
From: Nick Roberts <[log in to unmask]>
Date: Wed, 7 Nov 2001 22:22:03 -0000
Content-Type: text/plain; charset="iso-8859-1"
MIME-Version: 1.0
Reply-To: Nick Roberts <[log in to unmask]>
Parts/Attachments: text/plain (36 lines)
I see at least two errors instantly: (1) the comment says Inetger'Last is
2,147,486,647, but should say 2,147,483,647; (2) since the exception will be
raised in the declarative region of teh declare block (with the exception
handler), it will be propagated immediately out of the block (and the
handler will never receive it).

Keep trying!

--
Nick Roberts


----- Original Message -----
From: "Rick Duley" <[log in to unmask]>
To: <[log in to unmask]>
Sent: Wednesday, November 07, 2001 3:48 AM
Subject: Run-time checking


> Hi teamers,
>
> I was working on a demonstration exercise for students the other day and
> gave myself one heck of a surprise.
> The idea was that I could increment an integer variable past Integer'Last
> and trap the ensuing uproar, doing something useful with it without
crashing
> the program.  Well, ...that was the idea :(
>
> I am using GNAT 3.13p -- is this a problem with the compiler or have I
> misunderstood the purpose of CONSTRAINT_ERROR all these years?  Do I have
to
> do a manual check for run-time errors like this or am I doomed to have my
> jet plane turn upside down when the variable goes from positive to
negative?
> ;)

ATOM RSS1 RSS2