comp.lang.ada
 help / color / mirror / Atom feed
From: dewar@merv.cs.nyu.edu (Robert Dewar)
Subject: Re: Elaboration_check For Instantiations
Date: 1997/10/29
Date: 1997-10-29T00:00:00+00:00	[thread overview]
Message-ID: <dewar.878102996@merv> (raw)
In-Reply-To: 1997Oct28.192057.29122@nosc.mil


Charles Sampson says

<<     You are right, the GNAT implementation is entirely correct.  I
must have mislead you when I said "technically correct".  Technically
correct is correct, no doubt about it.  All I meant was that GNAT is not
following the programmer's wishes.  If Suppress(Elaboration_check) is
written, then the programmer doesn't want the check made; if the check
is not made then Program_error can't be raised.  The programmer's wisdom
in making such a request is another discussion.

                                Charlie>>


No, that's an incorrect viewpoint. The programmer is NOT saying that
they do not WANT the check, they are saying they do not NEED the check.
(because they know that the checked condition cannot occur). That is
a HUGE difference.

pragma Suppress (x)

does NOT mean "please suppress all checks for x", it means "I know my
program has no instances of violations of check x, so feel free to
omit checks for x if this will speed up the code."

Note that if a program with Suppress fails a check, then it is erroneous,
so a programmer cannot be expressing a wish about how the erroneous program
is to be treated.

A programmer who writes pragma Suppress not understanding this is not
"unwise", just ignorant of the meaning of Suppress in Ada, a common
failing of understanding.

GNAT is *exactly* following the programmer's wishes, but only if the 
programmer knows Ada! If the programmer is writing things down in
Ada thinking they mean something different from how they are defined,
then yes indeed, GNAT hopefully will *not* be following the programmer's
confusion.

I know, the name Suppress is somewhat inherently confusing, and undoubtedly
leads many programmers into the same confusion as Charlie has. Hard to know
what a better name might have been ... something like

Check_Not_Required (xxx)

??

Robert Dewar
Ada Core Technologies





  parent 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                 ` Robert Dewar
1997-10-29  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
1997-10-30  0:00                   ` Charles H. Sampson
     [not found]                   ` <345774b3.1434102@santaclara01.news.internex.net>
1997-10-30  0:00                     ` Charles H. Sampson
1997-10-29  0:00             ` Robert Dewar [this message]
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