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