home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #30 / NN_1992_30.iso / spool / comp / lang / ada / 3698 < prev    next >
Encoding:
Text File  |  1992-12-15  |  1.9 KB  |  44 lines

  1. Newsgroups: comp.lang.ada
  2. Path: sparky!uunet!spool.mu.edu!agate!linus!linus.mitre.org!linus!mbunix!eachus
  3. From: eachus@oddjob.mitre.org (Robert I. Eachus)
  4. Subject: Re: Language pitfalls (was Re: FORTRAN bug)
  5. In-Reply-To: stt@spock.camb.inmet.com's message of Tue, 15 Dec 1992 20:35:58 GMT
  6. Message-ID: <EACHUS.92Dec15202249@oddjob.mitre.org>
  7. Sender: news@linus.mitre.org (News Service)
  8. Nntp-Posting-Host: oddjob.mitre.org
  9. Organization: The Mitre Corp., Bedford, MA.
  10. References: <1992Dec15.135539.7245@lth.se> <EMERY.92Dec15095542@dr_no.mitre.org>
  11.     <1992Dec15.180821.17817@beaver.cs.washington.edu>
  12.     <1992Dec15.203558.18211@inmet.camb.inmet.com>
  13. Date: Wed, 16 Dec 1992 01:22:49 GMT
  14. Lines: 28
  15.  
  16. In article <1992Dec15.203558.18211@inmet.camb.inmet.com> stt@spock.camb.inmet.com (Tucker Taft) writes:
  17.  
  18.    Oh boy.  That is a nasty one.  This argues for a "friendly" 
  19.    Ada compiler giving a warning about any use of "null;" other
  20.    than the idiomatic ones like "when others => null;" or "begin null; end;"
  21.    (especially in a function that returns an access type ;-).
  22.  
  23.    In retrospect, one could argue that it would have been better
  24.    to have no "null" statement at all (other than simply ";") than
  25.    to create a situation allowing this kind of one word error.
  26.  
  27.     Actually, there is an Ada rule which normally catches this, and
  28. which Robert Dewar and I have argued should be removed in Ada 9X.  (A
  29. function must contain a return statement RM 6.5(1).)  If it belongs on
  30. the top ten list, then the rule should stay.
  31.  
  32.     (What Robert Dewar and I objected to was that certain functions
  33. whose only intended effect is to raise an exception must still contain
  34. a return statement.  This results in junk return statements in stubbed
  35. out code, and makes a stubber much harder to write.)
  36.  
  37. --
  38.  
  39.                     Robert I. Eachus
  40.  
  41. with Standard_Disclaimer;
  42. use  Standard_Disclaimer;
  43. function Message (Text: in Clever_Ideas) return Better_Ideas is...
  44.