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

  1. Newsgroups: comp.lang.ada
  2. Path: sparky!uunet!cs.utexas.edu!qt.cs.utexas.edu!yale.edu!spool.mu.edu!agate!eos!aio!dnsurber
  3. From: dnsurber@lescsse.jsc.nasa.gov (Douglas N. Surber)
  4. Subject: Re: Novice Question on Record Representation
  5. Message-ID: <dnsurber.724631545@node_26400>
  6. Sender: news@aio.jsc.nasa.gov (USENET News System)
  7. Organization: Lockheed Engineering and Sciences
  8. References: <1992Dec16.225712.23791@saifr00.cfsat.honeywell.com> <dnsurber.724602575@node_26400> <1992Dec17.182403.6353@telesoft.com>
  9. Date: 17 Dec 92 22:32:25 GMT
  10. Lines: 21
  11.  
  12. In <1992Dec17.182403.6353@telesoft.com> garym@telesoft.com (Gary Morris @pulsar) writes:
  13.  
  14. >Unfortunately, you can't rely on assertion like this.  The constant a1 is
  15. >not used anywhere and an optimizing compiler could remove a1 and the
  16. >expression used for its initial value (TSize = T'Size).  So the range check
  17. >never occurs and no exception or compile time warning is generated.  This
  18. >optimization is allowed by 11.6(7), when the only effect of a predefined
  19. >operation is to raise an exception. 
  20.  
  21. But a1 could be used in the package body, therefore it can't be optimized
  22. out during compilation of the package spec.  As I recall there is no
  23. requirement to issue a compile time warning in cases like this, but I
  24. am not aware of any compiler that doesn't.  Does anyone else know of any?
  25. I use the subtype Assertion a lot in my code and it occasionally catches
  26. things, but I guess I really shouldn't rely on it.
  27.  
  28.  
  29. --
  30. Douglas Surber             "Would you rather debug at
  31. Lockheed                    compile time or run time?"
  32. Houston, TX                      --Michael B. Feldman
  33.