comp.lang.ada
 help / color / mirror / Atom feed
* Vax Ada - Runtime Crashes
@ 1991-09-02 23:48 cis.ohio-state.edu!zaphod.mps.ohio-state.edu!wupost!waikato.ac.nz!pdenize
  0 siblings, 0 replies; only message in thread
From: cis.ohio-state.edu!zaphod.mps.ohio-state.edu!wupost!waikato.ac.nz!pdenize @ 1991-09-02 23:48 UTC (permalink / raw)


with Standard_Disclaimer;

My name is Paul Denize, until last year I was an Ada Programmer for the
Royal New Zealand Navy.  Since then I have been appointed a lecturer in
computer science at the University of Waikato.

I have upon arrival picked up on Vax Ada version 1.5 and discovered that 
the language behaves slightly differently to what I have been used to.

In the Navy I was using ALSYS Ada and unless I found a comiler flaw which the
company generally acknowledged then fixed your program NEVER crashed without 
generating an Ada Exception.  I had got quite used to this methodology.

However I toyed with Vax Ada and managed a number of crashes within an hour
which I would have expected a CONSTRAINT_ERROR for.

I defined an enumerated type say

    traffic_light_colour = (Red, Amber, Green);

Then I produced a generic bit operator called NOT and negated a variable of typ
e
traffic_light_colour.  Now Not Amber = Green, and Not Green = Amber, but 
Not Red resulted in a runtime death with no Ada Exception.


Should I have expected this ?

If I use unsafe methods to assign values how can I later check that the value
is within the bounds without causing a runtime failure.  It seems the compiler
generates assumptions about the bounds of a variable that under some instances
may not be true.  I have no problem with this I was the idiot that created the
unsafe conversion/assignment I should ensure the value(s) are safe.  HOW ?
Even more to the point what if its a record, Do I have to check every field ?

PEEEEUUUUUKKKKKEEEE !

Paul Denize.

-------------------------------------------------------------------------------
- Everyone agrees that the Modula-2 language has one ommision, no-one agrees  -
- what the ommission is.                                                      -
-------------------------------------------------------------------------------

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~1991-09-02 23:48 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
1991-09-02 23:48 Vax Ada - Runtime Crashes cis.ohio-state.edu!zaphod.mps.ohio-state.edu!wupost!waikato.ac.nz!pdenize

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