comp.lang.ada
 help / color / mirror / Atom feed
From: csampson@cod.nosc.mil (Charles H. Sampson)
Subject: Re: Elaboration_check For Instantiations
Date: 1997/10/29
Date: 1997-10-29T00:00:00+00:00	[thread overview]
Message-ID: <1997Oct29.171326.5702@nosc.mil> (raw)
In-Reply-To: dewar.878103469@merv

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain, Size: 2915 bytes --]


In article <dewar.878103469@merv>, Robert Dewar <dewar@merv.cs.nyu.edu> 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.




  reply	other threads:[~1997-10-29  0:00 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1997-10-23  0:00 Elaboration_check For Instantiations Charles H. Sampson
1997-10-23  0:00 ` Charles H. Sampson
1997-10-24  0:00   ` Tucker Taft
1997-10-24  0:00     ` Robert Dewar
1997-10-27  0:00       ` Charles H. Sampson
1997-10-27  0:00         ` Robert Dewar
1997-10-28  0:00           ` Charles H. Sampson
1997-10-28  0:00             ` Keith Thompson
1997-10-28  0:00               ` Charles H. Sampson
1997-10-29  0:00                 ` W. Wesley Groleau x4923
1997-10-29  0:00                   ` Tom Moran
1997-10-30  0:00                     ` Larry Kilgallen
     [not found]                   ` <345774b3.1434102@santaclara01.news.internex.net>
1997-10-30  0:00                     ` Charles H. Sampson
1997-10-30  0:00                   ` Charles H. Sampson
1997-10-29  0:00                 ` Robert Dewar
1997-10-29  0:00                   ` Charles H. Sampson [this message]
1997-10-29  0:00             ` Robert Dewar
1997-10-27  0:00     ` Charles H. Sampson
1997-10-27  0:00       ` Robert Dewar
1997-10-24  0:00 ` Robert Dewar
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox