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=-1.9 required=5.0 tests=BAYES_00 autolearn=ham autolearn_force=no version=3.4.4 X-Google-Thread: a07f3367d7,6651f3800ba2b6ac X-Google-Attributes: gida07f3367d7,public,usenet X-Google-NewGroupId: yes X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news1.google.com!news3.google.com!feeder.news-service.com!feeder.news-service.com!eternal-september.org!feeder.eternal-september.org!.POSTED!not-for-mail From: Adam Beneschan Newsgroups: comp.lang.ada Subject: Re: Aspect programming Date: Fri, 29 Jul 2011 12:48:16 -0700 Organization: A noiseless patient Spider Message-ID: References: <8bc7aeff-e8e1-4635-aea0-0687b02eede0@z14g2000yqh.googlegroups.com> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Injection-Date: Fri, 29 Jul 2011 19:48:14 +0000 (UTC) Injection-Info: mx04.eternal-september.org; posting-host="JqHjgPp5xM1RSLdgY0ShBA"; logging-data="23140"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/2J+lKQcXEQCfIPDRLh7fG" User-Agent: Mozilla/5.0 (Windows; U; Windows NT 6.0; en-US; rv:1.9.2.18) Gecko/20110616 Thunderbird/3.1.11 In-Reply-To: <8bc7aeff-e8e1-4635-aea0-0687b02eede0@z14g2000yqh.googlegroups.com> Cancel-Lock: sha1:xUJO+FFLoqJQMY7H8kpl823U/H0= Xref: g2news1.google.com comp.lang.ada:20419 Date: 2011-07-29T12:48:16-07:00 List-Id: 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