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

  1. Newsgroups: comp.lang.ada
  2. Path: sparky!uunet!spool.mu.edu!agate!linus!linus.mitre.org!texas!jclander
  3. From: jclander@texas.mitre.org (Julian C. Lander)
  4. Subject: Re: Language pitfalls (was Re: FORTRAN bug)
  5. Message-ID: <1992Dec16.200205.8912@linus.mitre.org>
  6. Sender: news@linus.mitre.org (News Service)
  7. Nntp-Posting-Host: fkuhl-pc.mitre.org
  8. Reply-To: jclander@texas.mitre.org (Julian C. Lander)
  9. Organization: The MITRE Corporation, McLean, Va
  10. References: <1992Dec15.135539.7245@lth.se> <EMERY.92Dec15095542@dr_no.mitre.org>     <1992Dec15.180821.17817@beaver.cs.washington.edu>     <1992Dec15.203558.18211@inmet.camb.inmet.com> <EACHUS.92Dec15202249@oddjob.mitre.org> <256@visicom.com>
  11. Date: Wed, 16 Dec 1992 20:02:05 GMT
  12. Lines: 29
  13.  
  14. In article <256@visicom.com>, rlk@VisiCom.COM (Bob Kitzberger) writes:
  15. |> eachus@oddjob.mitre.org (Robert I. Eachus) writes:
  16. |> 
  17. |> >    (What Robert Dewar and I objected to was that certain functions
  18. |> >whose only intended effect is to raise an exception must still contain
  19. |> >a return statement.  This results in junk return statements in stubbed
  20. |> >out code, and makes a stubber much harder to write.)
  21. |> 
  22. |> Robert, I can't think of a reason to have a function that does nothing
  23. |> but raise an exception... can you provide an example?  (I'm not
  24. |> questioning the need for it -- just curious)
  25. |> 
  26.  
  27. I didn't write this one, but it is in some code I'm using.
  28. The situation is interface with C-language functions, which return
  29. error codes.  The chunk of code before me (I don't know a good noun
  30. for what it is--it builds about 3 different executables) has a function
  31. called Raise_Appropriate_Exception, which raises the exception 
  32. corresponding to the return code it has been passed.
  33.  
  34. Since it never gets a 0 (its caller should avoid that), it doesn't return.
  35.  
  36. I don't know that it's the best solution to the problem (I'm not wild
  37. about it, frankly), but that's what I have.
  38.  
  39. Julian C. Lander
  40. jclander@mitre.org
  41.  
  42.  
  43.