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=-0.5 required=5.0 tests=BAYES_00,INVALID_MSGID, PP_MIME_FAKE_ASCII_TEXT autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII X-Google-Thread: 103376,55f243f32a97dc7e X-Google-Attributes: gid103376,public From: csampson@cod.nosc.mil (Charles H. Sampson) Subject: Re: Elaboration_check For Instantiations Date: 1997/10/29 Message-ID: <1997Oct29.171326.5702@nosc.mil>#1/1 X-Deja-AN: 286518344 Sender: news@nosc.mil References: <1997Oct23.205254.25272@nosc.mil> <878068940.763599@wagasa.cts.com> <1997Oct28.221806.2805@nosc.mil> Organization: Computer Sciences Corporation Newsgroups: comp.lang.ada Date: 1997-10-29T00:00:00+00:00 List-Id: In article , Robert Dewar wrote: > >If you say > >pragma Suppress (Elaboration_Check); > >You are telling the compiler: I have analyzed my program carefully and I >am sure that there are no instances of access before elaboration. I am sure >enough that you may consider any instance of such access to be erroneous, >and do whatever you like. I hope you will be able to use this information >I am supplying to improve the quality of the generated code. > I like this characterization, but I haven't yet found anything in the RM to support it. I wish something like that appeared somewhere, say in a note in 11.5. Lacking that, it looks more like a programming guideline on the "proper" use of Suppress than something that derives from the actual definition. >It sounds like Charlie thinks that the statement means something like > >I really don't want you to check for access before elaboration. I want >you to skip that check, and then carry on and do the "right thing". The >trouble is that there is not the slightest hint in the RM of what the >"right thing" might be here, since the RM gives not the slightest clue >of the semantics of such a situation. Not so. What I actually mean is, "I have decided that I want the check suppressed. Suppressing the check is a language feature and I don't have to justify to the compiler why I want it done. Just suppress it and carry on." That interpretation is weakened, as I have acknowl- edged before, by the fact that the compiler is not required to honor the request. I have always assumed (without any text in the RM to back me up) that the right to ignore the pragma was there to cover the cases when suppressing the check was too expensive, by some measure. In Ada 83, by suppressing a couple of checks you could often (or sometimes) obtain 32-bit or 16-bit modular arithmetic. Yes, an errone- ous program. I would never advocate such a thing and would do it myself only under the most extreme duress--such as in very tight time-critical code. However, once the programmer has made the decision to do it this way, I don't think it's the compiler's job to tell him he shouldn�t have. His colleagues' maybe, during code walk-throughs, but not the compiler's. > >Charlie, you really need to adjust your whole view of pragma Suppress. >It is completely wrong! I'm still not convinced it's completely wrong, but I like your above characterization so much that I'll probably adopt it, particularly for teaching. But then, that's not very different from the way I teach about Suppress already, just more nicely stated. I never teach people how to best exploit erroneous execution. Many of them are amazingly adept at discovering this themselves! Charlie -- ****** If my user name appears as "csampson", remove the 'c' to get my correct e-mail address.