home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #30 / NN_1992_30.iso / spool / comp / lang / ada / 3712 < prev    next >
Encoding:
Internet Message Format  |  1992-12-16  |  1.9 KB

  1. Path: sparky!uunet!usc!elroy.jpl.nasa.gov!ames!olivea!sgigate!sgi!wdl1!wdl39!mab
  2. From: mab@wdl39.wdl.loral.com (Mark A Biggar)
  3. Newsgroups: comp.lang.ada
  4. Subject: Re: Language pitfalls (was Re: FORTRAN bug)
  5. Message-ID: <1992Dec16.172717.19807@wdl.loral.com>
  6. Date: 16 Dec 92 17:27:17 GMT
  7. References: <1992Dec15.180821.17817@beaver.cs.washington.edu> <1992Dec15.203558.18211@inmet.camb.inmet.com> <EACHUS.92Dec15202249@oddjob.mitre.org>
  8. Sender: news@wdl.loral.com
  9. Organization: Loral Western Development Labs
  10. Lines: 24
  11.  
  12. In article <EACHUS.92Dec15202249@oddjob.mitre.org> eachus@oddjob.mitre.org (Robert I. Eachus) writes:
  13. >In article <1992Dec15.203558.18211@inmet.camb.inmet.com> stt@spock.camb.inmet.com (Tucker Taft) writes:
  14. >   Oh boy.  That is a nasty one.  This argues for a "friendly" 
  15. >   Ada compiler giving a warning about any use of "null;" other
  16. >   than the idiomatic ones like "when others => null;" or "begin null; end;"
  17. >   (especially in a function that returns an access type ;-).
  18. >   In retrospect, one could argue that it would have been better
  19. >   to have no "null" statement at all (other than simply ";") than
  20. >   to create a situation allowing this kind of one word error.
  21. >    Actually, there is an Ada rule which normally catches this, and
  22. >which Robert Dewar and I have argued should be removed in Ada 9X.  (A
  23. >function must contain a return statement RM 6.5(1).)  If it belongs on
  24. >the top ten list, then the rule should stay.
  25. >    (What Robert Dewar and I objected to was that certain functions
  26. >whose only intended effect is to raise an exception must still contain
  27. >a return statement.  This results in junk return statements in stubbed
  28. >out code, and makes a stubber much harder to write.)
  29.  
  30. How about a rule that requires a function to contain either a return or an
  31. explisit raise statement?  Would that not satisfy both sides?
  32.  
  33. --
  34. Mark Biggar
  35. mab@wdl1.wdl.loral.com
  36.