Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Posting-Version: version B 2.10.1 6/24/83; site petsd.UUCP Path: utzoo!watmath!clyde!cbosgd!ihnp4!mhuxn!mhuxr!mhuxt!houxm!vax135!petsd!joe From: joe@petsd.UUCP (Joe Orost) Newsgroups: net.arch,net.lang.ada Subject: Re: Subscript out-of-bounds detection Message-ID: <652@petsd.UUCP> Date: Mon, 30-Sep-85 16:00:15 EDT Article-I.D.: petsd.652 Posted: Mon Sep 30 16:00:15 1985 Date-Received: Wed, 2-Oct-85 06:13:53 EDT References: <796@kuling.UUCP> <2580002@csd2.UUCP> <191@graffiti.UUCP> <568@unisoft.UUCP> Reply-To: joe@petsd.UUCP (Joseph M. Orost) Organization: Perkin-Elmer DSG, Tinton Falls, N.J. Lines: 41 Xref: watmath net.arch:1835 net.lang.ada:367 In article <568@unisoft.UUCP> phil@unisoft.UUCP (Phil Ronzone) writes: >Shucks - but I still CAN'T see how much the poor pilot in an F16 with an >Ada programmed fire-control computer is going to be as a Mig-27 bears down >on him, and right when he hears the lock-on buzz to fire his own missile -- > > Ada runtime error 498: subscript i value 23 out of range for array x (20) > >I mean, > > Bus error - core dumped > >reads quicker and thus gives the pilot a faster ``oh shit'' response time >to take evasive action .... :-) :-) Ada isn't as verbose as you think. The Ada compiler I once used gave the following run-time message: raise: no handler and NO CORE DUMP! Try to find the bug there? However, there are some flaws in your "Bus error" logic. An out-of-bounds array subscript may not make the C or Fortran program die. It just might overwrite some random variable! Say it overwrote the current altitude and caused the plane to nose dive! Wouldn't it be better for the error to just abort the subroutine it was in, and allow the rest of the program to recover, like Ada provides? Remember, it was the DoD that came up with the guidelines for the design of Ada in the first place. regards, joe -- ........ ......... Full-Name: Joseph M. Orost . . . UUCP: ihnp4!vax135!petsd!joe . ...... ... ........ ARPA: vax135!petsd!joe@BERKELEY . . Phone: (201) 758-7284 . ......... Location: 40 19'49" N / 74 04'37" W US Mail: MS 313; Perkin-Elmer; 106 Apple St Tinton Falls, NJ 07724 Brought to you by Super Global Mega Corp .com