comp.lang.ada
 help / color / mirror / Atom feed
* Hide annotations on procedures.
@ 2009-06-12 13:35 xorque
  2009-06-12 13:51 ` Phil Thornley
  0 siblings, 1 reply; 3+ messages in thread
From: xorque @ 2009-06-12 13:35 UTC (permalink / raw)


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:

  procedure C_Readlink_Boundary
    (File_Name     : in String;
     Buffer        : out String;
     Buffer_Size   : in File.File_Name_Index_t;
     Returned_Size : out C_Types.Signed_Size_t)
  is
    --# hide C_Readlink_Boundary
  begin
    null;
  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:

   7    procedure C_Readlink_Boundary
                  ^
***        Semantic Error    :154: The subprogram or task body
C_Readlink_Boundary
           does 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?



^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: Hide annotations on procedures.
  2009-06-12 13:35 Hide annotations on procedures xorque
@ 2009-06-12 13:51 ` Phil Thornley
  2009-06-12 20:47   ` xorque
  0 siblings, 1 reply; 3+ messages in thread
From: Phil Thornley @ 2009-06-12 13:51 UTC (permalink / raw)


On 12 June, 14:35, xorque <xorquew...@googlemail.com> 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:
>
>   procedure C_Readlink_Boundary
>     (File_Name     : in String;
>      Buffer        : out String;
>      Buffer_Size   : in File.File_Name_Index_t;
>      Returned_Size : out C_Types.Signed_Size_t)
>   is
>     --# hide C_Readlink_Boundary
>   begin
>     null;
>   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:
>
>    7    procedure C_Readlink_Boundary
>                   ^
> ***        Semantic Error    :154: The subprogram or task body
> C_Readlink_Boundary
>            does 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



^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: Hide annotations on procedures.
  2009-06-12 13:51 ` Phil Thornley
@ 2009-06-12 20:47   ` xorque
  0 siblings, 0 replies; 3+ messages in thread
From: xorque @ 2009-06-12 20:47 UTC (permalink / raw)


Phil Thornley wrote:
> The derives annotation is certainly needed and goes immediately after
> the procedure declaration - before the 'is'. (The hide goes after the
> 'is'.)

Argh!

I was putting it after the 'is'.

Nice catch...



^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2009-06-12 20:47 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-06-12 13:35 Hide annotations on procedures xorque
2009-06-12 13:51 ` Phil Thornley
2009-06-12 20:47   ` xorque

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