comp.lang.ada
 help / color / mirror / Atom feed
From: "Sébastien Morand" <seb.morand@gmail.com>
Subject: Re: Generic warning
Date: Tue, 17 Jun 2008 18:33:42 +0000
Date: 2008-06-17T18:33:42+00:00	[thread overview]
Message-ID: <g39028$2mk$1@registered.motzarella.org> (raw)
In-Reply-To: iyg4tdla7x2a.1e9ubbvqz88c0$.dlg@40tude.net

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

> Maybe it is just a compiler bug. But you should post a complete compilable
> code.

Here is a complete code with the same warning:

procedure Main is

   generic
      --  Element to be stored in the btree
      type Element (<>) is private;
      Order: Positive;
   package TestGen is

      type ElementPtr is access all Element;

      Buffer: array(1 .. Order*2) of ElementPtr;
      procedure Store(E: in Element; index: in Positive);

   end TestGen;

   package body TestGen is

      procedure Store(E: in Element; index: in Positive) is
      begin
         --  In my real procedure, index is calculated and there is some
         --  check. Index can't be > Order*2
         for i in Positive range Order+2 .. index-1 loop
            Buffer(i) := new Element'(E);
         end loop;
      end Store;

   end TestGen;

   package IntTestGen is new TestGen(
      Element => Integer,
      Order => 1
   );
   use IntTestGen;

begin

   Store(1, 4);

end Main;

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.5 (Cygwin)

iD8DBQFIWAOF+zV9xm4PlDQRAqdzAJ9Oa+0fS1VgOMo8dypPhkDgpNC0pQCfWwC1
cCWtqImCosykrr1tzGBf8gY=
=J0c5
-----END PGP SIGNATURE-----



  reply	other threads:[~2008-06-17 18:33 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-06-17 16:44 Generic warning Sébastien Morand
2008-06-17 17:17 ` Dmitry A. Kazakov
2008-06-17 18:33   ` Sébastien Morand [this message]
2008-06-17 19:04     ` Dmitry A. Kazakov
2008-06-18  8:41       ` Sébastien Morand
2008-06-18 14:16         ` Brian Drummond
2008-06-18 14:32           ` Sébastien Morand
2008-06-18 14:39             ` Ed Falis
2008-06-18 14:42             ` Dmitry A. Kazakov
2008-06-18 15:10               ` Robert A Duff
2008-06-18 15:25                 ` Dmitry A. Kazakov
2008-06-18 15:38                   ` Ed Falis
2008-06-18 17:04                     ` Dmitry A. Kazakov
2008-06-17 18:20 ` Jeffrey R. Carter
2008-06-18  8:55   ` Sébastien Morand
replies disabled

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