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

  1. Newsgroups: comp.lang.ada
  2. Path: sparky!uunet!psinntp!calspan!westley
  3. From: westley@calspan.com (Terry J. Westley)
  4. Subject: Re: Language pitfalls (was Re: FORTRAN bug)
  5. Message-ID: <1992Dec17.141856.10631@calspan.com>
  6. Sender: usenet@calspan.com
  7. Nntp-Posting-Host: hercules
  8. Organization: Calspan Advanced Technology Center
  9. References: <1992Dec15.180821.17817@beaver.cs.washington.edu> <1992Dec15.203558.18211@inmet.camb.inmet.com> <EACHUS.92Dec15202249@oddjob.mitre.org>
  10. Date: Thu, 17 Dec 1992 14:18:56 GMT
  11. Lines: 39
  12.  
  13. In article <EACHUS.92Dec15202249@oddjob.mitre.org> eachus@oddjob.mitre.org (Robert I. Eachus) writes:
  14. >    Actually, there is an Ada rule which normally catches this,
  15.  
  16. ["this" refers to substituting "null" for "return null" by mistake]
  17.  
  18. >and
  19. >which Robert Dewar and I have argued should be removed in Ada 9X.  (A
  20. >function must contain a return statement RM 6.5(1).)  If it belongs on
  21. >the top ten list, then the rule should stay.
  22. >
  23. >    (What Robert Dewar and I objected to was that certain functions
  24. >whose only intended effect is to raise an exception must still contain
  25. >a return statement.  This results in junk return statements in stubbed
  26. >out code, and makes a stubber much harder to write.)
  27. >
  28. >--
  29. >
  30. >                    Robert I. Eachus
  31.  
  32. Many compilers produce a warning for such a situation.  IMHO, this is
  33. good but doesn't go far enough.
  34.  
  35. I hate compiler warnings; I will typically do anything to eliminate them
  36. because I done't want to keep rereading the same warnings every time a unit
  37. is compiled.  Sometimes, they cannot be eliminated as in the example above.
  38.  
  39. I would like to have the ability, perhaps with a pragma, which allows me to
  40. tell the compiler that I know a certain statement will raise a warning of
  41. a certain class and to suppress the warning.  This must be done on a statement
  42. by statement (really warning by warning) basis.  Turning off all the warnings
  43. is too dangerous.  They really are useful.
  44.  
  45. Have any compiler gurus considered this?
  46.  
  47. -- 
  48. Terry J. Westley, Principal Computer Scientist
  49. Calspan Corporation, P.O. Box 400, Buffalo, NY 14225
  50. westley@calspan.com
  51. Let's hear it for smart mailers that cut off long signa
  52.