Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Posting-Version: version B 2.10.2 9/18/84; site harvard.ARPA Path: utzoo!watmath!clyde!burl!ulysses!allegra!mit-eddie!genrad!panda!talcott!harvard!macrakis From: macrakis@harvard.ARPA (Stavros Macrakis) Newsgroups: net.lang Subject: nil dereferencing in Ada and C Message-ID: <355@harvard.ARPA> Date: Thu, 31-Jan-85 17:44:23 EST Article-I.D.: harvard.355 Posted: Thu Jan 31 17:44:23 1985 Date-Received: Sat, 2-Feb-85 10:51:51 EST References: <2340@hplabsc.UUCP> <4948@utzoo.UUCP> <6292@boring.UUCP> <536@mako.UUCP> <6881@watdaisy.UUCP> <560@mako.UUCP> Distribution: net Organization: Aiken Comp. Lab., Harvard Lines: 19 > when CONSTRAINT_ERROR => ... --Jan Steinman, tektronix!tekecs!jans Of course, Ada -detects- the nil pointer dereference (dynamically) regardless of whether you have an exception handler. Any reasonable Ada system will do something useful if an exception is totally unhandled, like print out the procedure call tree and perhaps the local environment. As for dynamic checking for C, a student here, Sam Kendall, spent last year designing and writing a C compiler (bcc) which checks for nil dereferencing, out-of-bounds array references, and other dynamic errors. It operates by pre-processing the C. Unlike a good Ada compiler, though, it does no optimization or constraint propagation (so the resulting code can be quite big and slow), and, of course, your code has to avoid all the usual C type-punning. He can be reached at Kendall@Harvard.ARPA/UUCP phone 617-495-2258; the company he did this for is Delft Consulting of NYC. -s