comp.lang.ada
 help / color / mirror / Atom feed
From: Lutz Donnerhacke <lutz@iks-jena.de>
Subject: [Spark] Converting Arrays
Date: Mon, 10 Mar 2003 17:06:28 +0000 (UTC)
Date: 2003-03-10T17:06:28+00:00	[thread overview]
Message-ID: <slrnb6phge.1gd.lutz@taranis.iks-jena.de> (raw)

I run into a difficult problem (for me):
$ cat test.ada <<END
package test is
   type Fullpath is array(Positive range <>) of Character; 
   procedure To_Fullpath (s : String; path : out Fullpath);    
   --# derives path from s;       
end test;

package body test is
   procedure To_Fullpath (s : String; path : out Fullpath) is 
   begin    
      path := Fullpath'(others => ASCII.NUL);       
      for i in Positive range 1 .. s'Length loop             
        path (path'First + i) := s (s'First + i);        
      end loop;
   end To_Fullpath;
end test;
END
$ spark test.ada
          *******************************************************
       SPARK95 Examiner with VC and RTC Generator Release 6.3 / 11.02
                           Demonstration Version
          *******************************************************


                       DATE : 10-MAR-2003 18:05:17.49


           Examining the specification of package test ...

           Examining the body of package test ...

  10        path := Fullpath'(others => ASCII.NUL);
            ^
***   Semantic Error    : 39: Illegal use of unconstrained type.
                    ^
***   Semantic Error    : 39: Illegal use of unconstrained type.
                    ^
***   Semantic Error    : 39: Illegal use of unconstrained type [Barnes 6.7].

           Generating listing file test.lst ...

           Generating report file ...


-----------End of SPARK Examination--------------------------------


Any idea, how to write this correctly?



             reply	other threads:[~2003-03-10 17:06 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-03-10 17:06 Lutz Donnerhacke [this message]
2003-03-10 20:03 ` [Spark] Converting Arrays James S. Rogers
2003-03-10 22:33   ` Lutz Donnerhacke
2003-03-11 10:14 ` Rod Chapman
2003-03-11 10:51   ` Lutz Donnerhacke
2003-03-11 10:52   ` Lutz Donnerhacke
2003-03-11 20:46     ` JP Thornley
2003-03-12  8:43       ` Phil Thornley
2003-03-12 11:57         ` Lutz Donnerhacke
2003-03-12 18:46           ` JP Thornley
2003-03-13 10:14             ` Lutz Donnerhacke
2003-03-12  9:43     ` Rod Chapman
2003-03-12 10:15       ` Lutz Donnerhacke
  -- strict thread matches above, loose matches on Subject: below --
2003-03-13  5:55 Grein, Christoph
2003-03-13  9:47 ` Peter Amey
2003-03-13 10:15   ` Lutz Donnerhacke
2003-03-21 15:05     ` Peter Amey
2003-03-21 15:17       ` Lutz Donnerhacke
replies disabled

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