comp.lang.ada
 help / color / mirror / Atom feed
From: Adam Beneschan <adam@irvine.com>
Subject: Re: Aspect programming
Date: Fri, 29 Jul 2011 12:48:16 -0700
Date: 2011-07-29T12:48:16-07:00	[thread overview]
Message-ID: <j0v2pu$mj4$1@dont-email.me> (raw)
In-Reply-To: <8bc7aeff-e8e1-4635-aea0-0687b02eede0@z14g2000yqh.googlegroups.com>

On 7/29/2011 9:09 AM, Anh Vo wrote:

>>> If you want it to apply to all units, you have to use it as a
>>> configuration pragma.
>>
>> It's not clear which one applies in the original poster's case.  If GNAT
>> does disallow more than one compilation unit per file, then clearly the
>> source in the original post must actually be multiple files (or else it
>> wouldn't have worked), and we weren't really told where the dividing
>> lines between the files are.  For all we know, the first
>> Assertion_Policy pragma could have been in its own file.
>
> Actually, each program unit is in a separate file per GNAT convention.
> While posting, I just copy and past their contents one after the
> other.

In that case, where was the Assertion_Policy pragma that you included at 
the top of your source?  In the same file as Aspect_Programming_Test, or 
in its own file?  If "file" == "compilation" on GNAT, then according to 
the language rules, if you included it in the same file (compilation) as 
the procedure, it would have applied only to the procedure.

However it's done, I believe that Assertion_Policy(Check) has to be 
applied to the specification of the Stacks generic package in order for 
you to get the checks to happen.  I don't know what works on GNAT or 
what doesn't.  But adding the pragma to the top of stacks.ads should 
work.  Compiling it as a configuration pragma that applies to "all 
future compilation_units compiled into the same environment" (10.1.5(8)) 
should work too, according to the language rules, but Martin's earlier 
comment seems to imply that it doesn't.

				-- Adam



  reply	other threads:[~2011-07-29 19:48 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-07-27 16:29 Aspect programming Anh Vo
2011-07-28  4:56 ` AdaMagica
2011-07-28 14:25   ` Robert A Duff
2011-07-28 18:13   ` Adam Beneschan
2011-07-28 19:38     ` Adam Beneschan
2011-07-29 16:09     ` Anh Vo
2011-07-29 19:48       ` Adam Beneschan [this message]
2011-07-29 11:03   ` Martin
2011-07-30  2:31     ` Harry Tucker
2011-08-01 18:20   ` Anh Vo
2011-08-11 22:58 ` Yannick Duchêne (Hibou57)
replies disabled

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