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=unavailable autolearn_force=no version=3.4.4 Path: eternal-september.org!reader01.eternal-september.org!reader02.eternal-september.org!feeder.eternal-september.org!gandalf.srv.welterde.de!news.jacob-sparre.dk!franka.jacob-sparre.dk!pnx.dk!.POSTED.rrsoftware.com!not-for-mail From: "Randy Brukardt" Newsgroups: comp.lang.ada Subject: Re: Formal Subprogram Access Date: Tue, 13 Feb 2018 18:53:16 -0600 Organization: JSA Research & Innovation Message-ID: References: Injection-Date: Wed, 14 Feb 2018 00:53:16 -0000 (UTC) Injection-Info: franka.jacob-sparre.dk; posting-host="rrsoftware.com:24.196.82.226"; logging-data="18136"; mail-complaints-to="news@jacob-sparre.dk" X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2900.5931 X-RFC2646: Format=Flowed; Original X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.7246 Xref: reader02.eternal-september.org comp.lang.ada:50436 Date: 2018-02-13T18:53:16-06:00 List-Id: "Simon Wright" wrote in message news:lyeflpkrh3.fsf@pushface.org... > "Randy Brukardt" writes: > >> There's no such rule in the RM. As Christoph noted, a generic formal >> subprogram has convention Ada, 'Access is allowed. If you pass an >> attribute to it, you have to wrap it in a real subprogram for this >> reason. (There is a lot of code specifically to do this in Janus/Ada, >> it probably never has been tested outside of a single ACATS test -- I >> don't think anyone ever has had a reason to pass an attribute like >> Succ as a formal subprogram.) > > In GNAT, I've passed 'Image, 'Value as actuals for corresponding formal > subprograms. It should be legal to do that. My point is that I don't think that there are many such uses in practice (I've never written one), so it's rather likely that the special code to implement those is mostly untested. I'm pretty sure that there is a few Ada 83 ACATS tests that do this, but nothing for newer attributes (like 'Read). > generic > type Checked_Type is private; > Checked_Type_Name : String; > with function "=" (L, R : Checked_Type) return Boolean is <>; > with function Value (S : String) return Checked_Type is <>; > with function Image (V : Checked_Type) return String is <>; > package Check_Passed_Value is > > Which ACATS test should have caught that (or any other attribute, of > course)? I don't know of any easy way to find that out, and I don't have time to read roughly 4000 tests to find one. Sorry. > I see that the GCC-based tests that I've been working on at > https://github.com/simonjwright/ACATS wouldn't necessarily catch all the > errors expected in the B (and L?) tests: for example, BC70009 reports 4 > compilation errors, which counts as a success because of course B tests > are expected to fail, but doesn't check that all the expected errors > have in fact been caught. (In this case, 4 was correct.) I should check > the grading tool, though I'm not sure that complete conformance checks > are justified in this context - it's more to ensure that some feature > hasn't been broken. I have a set of tools for running the grading tool with GNAT. I've been waiting to find some time to finish vetting the results, which I've recently done. [Although I really ought to redo it with GNAT 18.1.] So I'll be posting them soon as "submitted tests" (since compiler-specific stuff doesn't belong in the ACATS proper). Randy.