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,45a9122ddf5fcf5 X-Google-Attributes: gid103376,public From: mab@dst17.wdl.loral.com (Mark A Biggar) Subject: Re: Rules for Representation of Subtypes Date: 1996/09/27 Message-ID: <52hnvh$li0@wdl1.wdl.lmco.com>#1/1 X-Deja-AN: 185719893 references: <1996Sep26.191257.1@eisner> organization: Loral Western Development Labs newsgroups: comp.lang.ada Date: 1996-09-27T00:00:00+00:00 List-Id: In article bobduff@world.std.com (Robert A Duff) writes: >In article <1996Sep26.191257.1@eisner>, >Larry Kilgallen wrote: >>Like: >> if X'Valid >>? I would think that as being an argument in _favor_ of declaring >>the C-updated object in a tightly constrained fashion. >No, that won't work. By the time you get to that if statement, the >program execution is already erroneous. Compilers can and do (and >should) take advantage of that fact to generate faster code that doesn't >work. An unchecked conversion is a function call, and there's no way to >capture the result of it without assigning it somewhere, which causes >erroneousness if the result is bad. I'm not sure about this as I always thought that the RM was pretty clear that only the USE of an abnormal value was erroneous, but that simply assigning it was safe, at least I'm sure that was the intent, otherwise X'VALID after an unchecked conversion is useless, but that is one of the explisit examples of its intended use in the RM. -- Mark Biggar mab@wdl.lmco.com