From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-1.3 required=5.0 tests=BAYES_00,INVALID_MSGID autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,74a56083ffbe573d X-Google-Attributes: gid103376,public From: Ted Dennison Subject: Re: Zoo question Date: 1996/08/19 Message-ID: <32189B55.2F1CF0FB@escmail.orl.mmc.com>#1/1 X-Deja-AN: 175117282 references: <320F16B6.6944@lmtas.lmco.com> <3210A142.2781E494@escmail.orl.mmc.com> <3211C462.19D9@lmtas.lmco.com> content-type: text/plain; charset=us-ascii organization: Lockheed Martin Information Systems mime-version: 1.0 newsgroups: comp.lang.ada x-mailer: Mozilla 2.0 (X11; I; SunOS 4.1.3_U1 sun4m) Date: 1996-08-19T00:00:00+00:00 List-Id: Robert Dewar wrote: > > Ken has been a little coy with this example, but his original post and a > followup strongly suggest that there is some mysterious justification for > the above code failing to work in the obvious manner. Yeah, I think its about time for Ken to tell us what he's seeing. > The 'Valid attribute has nothing at all to do with the case, it is for use > in cases where by various means you manage to get an abnormal or undefined > value into a variable (e.g. it is uninitialized, set by a bad unchecked > conversion, read from a stream, etc.) I've been burned so many times in the above cases, that I have developed a rather cynical attitude towards constraint checking. Its nice to see that there are some cases where you CAN count on it (assuming it hasn't been supressed, or compiled with Ken's compiler). > Possibility 3 is definitely NOT correct. The reason I am reemphasizing > this is that to me the suggestion that this might not work and cannot > be relied on may be very unsettling to those who do not know Ada well > enough to be confident that statements like this are false. Of COURSE > the CE is caught by the handler, you can move CE's around a bit, but > not outside the frame. Since we are talking Ada 83 here (though Ada 95 > is no different), let's quote from the Ada 83 RM, 11.6(4) says > > second, for each operation, the innermost enclosing frame or accept > statement mnust be the same in the alternative order as in the canonical > order, and the same exception handlers must apply. Ahh. That's the piece I was missing. I knew it could be moved. I had just never heard the limitations before. Out of curiosity, what counts as a "frame"? Is it just subprograms and "begin" blocks? > > As to possibility 2, yes, certainly if you suppress constraint errors > this code will not work. > > In GNAT, we have introduced a pragma Unsuppress, which undoes the effect > of any Suppress (either from the command line switch or from a pragma Interesting... Do you have a "resuppress" compiler option? :-) -- T.E.D. | Work - mailto:dennison@escmail.orl.mmc.com | | Home - mailto:dennison@iag.net | | URL - http://www.iag.net/~dennison |