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,FREEMAIL_FROM autolearn=ham autolearn_force=no version=3.4.4 X-Google-Thread: a07f3367d7,45974c4ba2f5422c X-Google-Attributes: gida07f3367d7,public,usenet X-Google-NewGroupId: yes X-Google-Language: ENGLISH,ASCII Path: g2news2.google.com!postnews.google.com!j32g2000yqh.googlegroups.com!not-for-mail From: Phil Thornley Newsgroups: comp.lang.ada Subject: Re: Hide annotations on procedures. Date: Fri, 12 Jun 2009 06:51:20 -0700 (PDT) Organization: http://groups.google.com Message-ID: <46a4a9cf-a5b7-4fd7-8c79-c271cb0a93ea@j32g2000yqh.googlegroups.com> References: NNTP-Posting-Host: 80.177.171.182 Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable X-Trace: posting.google.com 1244814681 10075 127.0.0.1 (12 Jun 2009 13:51:21 GMT) X-Complaints-To: groups-abuse@google.com NNTP-Posting-Date: Fri, 12 Jun 2009 13:51:21 +0000 (UTC) Complaints-To: groups-abuse@google.com Injection-Info: j32g2000yqh.googlegroups.com; posting-host=80.177.171.182; posting-account=Fz1-yAoAAACc1SDCr-Py2qBj8xQ-qC2q User-Agent: G2/1.0 X-HTTP-UserAgent: Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 5.1; Trident/4.0; .NET CLR 1.1.4322; .NET CLR 2.0.50727),gzip(gfe),gzip(gfe) Xref: g2news2.google.com comp.lang.ada:6446 Date: 2009-06-12T06:51:20-07:00 List-Id: On 12 June, 14:35, xorque wrote: > Having failed to take the day off from learning SPARK, I've run into > a strange problem regarding procedure annotations. > > I have the following in a package body: > > =A0 procedure C_Readlink_Boundary > =A0 =A0 (File_Name =A0 =A0 : in String; > =A0 =A0 =A0Buffer =A0 =A0 =A0 =A0: out String; > =A0 =A0 =A0Buffer_Size =A0 : in File.File_Name_Index_t; > =A0 =A0 =A0Returned_Size : out C_Types.Signed_Size_t) > =A0 is > =A0 =A0 --# hide C_Readlink_Boundary > =A0 begin > =A0 =A0 null; > =A0 end C_Readlink_Boundary; > > The body of the procedure is obviously not implemented yet. The > procedure > itself is defined only in the body of the package, not accessible from > outside. > The body of the procedure is intended to be hidden from SPARK. The > problem > I have is that SPARK doesn't seem to get it: > > =A0 =A07 =A0 =A0procedure C_Readlink_Boundary > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 ^ > *** =A0 =A0 =A0 =A0Semantic Error =A0 =A0:154: The subprogram or task bod= y > C_Readlink_Boundary > =A0 =A0 =A0 =A0 =A0 =A0does not have an annotation. > > The procedure doesn't touch any global variables. Any 'derives' > annotation added to the procedure is rejected by SPARK (as it would > need to > go on the procedure specification - which doesn't exist). I've used > the same > pattern on functions, not procedures, and SPARK has accepted it. > > What have I done wrong here? The derives annotation is certainly needed and goes immediately after the procedure declaration - before the 'is'. (The hide goes after the 'is'.) Are you getting it in the wrong position, or making some other error in that annotation? Phil Thornley