comp.lang.ada
 help / color / mirror / Atom feed
From: dewar@merv.cs.nyu.edu (Robert Dewar)
Subject: Re: Assertions in Ada
Date: 1997/08/25
Date: 1997-08-25T00:00:00+00:00	[thread overview]
Message-ID: <dewar.872559855@merv> (raw)
In-Reply-To: 199708251351.PAA13197@basement.replay.com


Jeff said

<<another post by R. Dewar. The package provides checking even with
compilers that don't support pragma Assert. The advantage of the pragma
is that you can use it in a declarative region, where a procedure call
is not allowed. I considered also providing a function for use in
declarative regions, but didn't, because I expect optimization to
eliminate the unused constants I would declare with the function.>>


The constants could be eliminated, but not their initializing expressions
if they have potential side effects, which the assert call most surely
does, so your fear of being done in by the optimizer here is groundless.

Incidentally, GNAT also provides pragma Debug:

  pragma Debug (procedure-call-statement);

which is a procedure call that can be turned on or off by an external
compiler switch, and which can occur in a declarative region. This
allows more general processing than the assert pragma.





  parent reply	other threads:[~1997-08-25  0:00 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1997-08-21  0:00 Assertions in Ada AdaWorks
1997-08-21  0:00 ` Tucker Taft
1997-08-21  0:00   ` Brian Rogoff
1997-08-22  0:00     ` Robert Dewar
     [not found]   ` <JSA.97Aug21183650@alexandria.organon.com>
1997-08-21  0:00     ` Robert Dewar
1997-08-22  0:00       ` Tucker Taft
1997-08-23  0:00         ` Ken Garlington
1997-08-24  0:00           ` Brian Rogoff
     [not found]         ` <199708251351.PAA13197@basement.replay.com>
1997-08-25  0:00           ` Robert Dewar [this message]
1997-08-27  0:00             ` Adrian P. Morgan
1997-08-31  0:00               ` Robert A Duff
1997-08-23  0:00   ` Ken Garlington
1997-08-24  0:00     ` Robert Dewar
  -- strict thread matches above, loose matches on Subject: below --
1997-08-22  0:00 AdaWorks
replies disabled

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