Talk About Network

Google


Register and Login
Nick
Password
Register create new account Sign up is FREE and you can post replies, new topics, bookmark posts and more!
Recover lost password


Programming > Ada > Generic warning
Latest [ Topics | Posts ] Archive Post A New Topic Post a Reply
<< Topic < Post Post 1 of 15 Topic 5759 of 5881
Post > Topic >>

Generic warning

by =?ISO-8859-1?Q?S=E9bastien_Morand?= <seb.morand@[EMAIL PROTECTED] > Jun 17, 2008 at 04:44 PM

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

Hi,

I'm implementing a B-Tree in Ada using indefinite private type:

generic
   --  Element to be stored in the btree
   type Element (<>) is private;
   --  Null element when not found
   Element_Null: Element;
   --  Key of the element in the B-Tree wich must be compareable
   type Key (<>) is private;
   with function "<"(k1: in Key; k2: in Key) return Boolean;
   with function ">"(k1: in Key; k2: in Key) return Boolean;
   with procedure Put_Line(k: in Key);
   --  Order of the B-Tree
   Order: Positive;
package SCMAL.Tools.BTrees is

   --  Omitted

end SCMAL.Tools.BTrees;


When I create an instance of the package using the following code:

 9   package IT is new SCMAL.Tools.BTrees(
10      Element => Integer,
11      Element_Null => 0,
12      Key => Integer,
13      "<" => "<",
14      ">" => ">",
15      Put_Line => Put_Line,
16      Order => 1
17   );

I got the following warnings:
btreetests.adb:9:04: warning: in instantiation at
scmal-tools-btrees.adb:159
btreetests.adb:9:04: warning: value not in range of subtype of
"Standard.Integer" defined at scmal-tools-btrees.ads:82, instance at line
9
btreetests.adb:9:04: warning: "Constraint_Error" will be raised at run
time
btreetests.adb:9:04: warning: in instantiation at
scmal-tools-btrees.adb:160
btreetests.adb:9:04: warning: value not in range of subtype of
"Standard.Integer" defined at scmal-tools-btrees.ads:83, instance at line
9
btreetests.adb:9:04: warning: "Constraint_Error" will be raised at run
time
btreetests.adb:9:04: warning: in instantiation at
scmal-tools-btrees.adb:161
btreetests.adb:9:04: warning: value not in range of subtype of
"Standard.Integer" defined at scmal-tools-btrees.ads:84, instance at line
9
btreetests.adb:9:04: warning: "Constraint_Error" will be raised at run
time
btreetests.adb:9:04: warning: in instantiation at
scmal-tools-btrees.adb:177
btreetests.adb:9:04: warning: value not in range of subtype of
"Standard.Integer" defined at scmal-tools-btrees.ads:82, instance at line
9
btreetests.adb:9:04: warning: "Constraint_Error" will be raised at run
time
btreetests.adb:9:04: warning: in instantiation at
scmal-tools-btrees.adb:178
btreetests.adb:9:04: warning: value not in range of subtype of
"Standard.Integer" defined at scmal-tools-btrees.ads:83, instance at line
9
btreetests.adb:9:04: warning: "Constraint_Error" will be raised at run
time

but I run time it works fine and I have no constraint error.

Where theses warnings come from? How to correct my code?
Is there a way to avoid to take the default "<" and ">" function?

Thanks by advance,
Sebastien
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.5 (Cygwin)

iD8DBQFIV+na+zV9xm4PlDQRAn1vAJ4hWuphvyP5DAU/zTB2iH4jP+DuMQCdF252
4ZGus6+yxjCwqug3lqycgsY=
=XSuj
-----END PGP SIGNATURE-----
 




 15 Posts in Topic:
Generic warning
=?ISO-8859-1?Q?S=E9bastie  2008-06-17 16:44:10 
Re: Generic warning
"Dmitry A. Kazakov&q  2008-06-17 19:17:01 
Re: Generic warning
=?ISO-8859-1?Q?S=E9bastie  2008-06-17 18:33:42 
Re: Generic warning
"Dmitry A. Kazakov&q  2008-06-17 21:04:38 
Re: Generic warning
=?ISO-8859-1?Q?S=E9bastie  2008-06-18 08:41:31 
Re: Generic warning
Brian Drummond <brian_  2008-06-18 15:16:42 
Re: Generic warning
=?ISO-8859-1?Q?S=E9bastie  2008-06-18 14:32:28 
Re: Generic warning
"Dmitry A. Kazakov&q  2008-06-18 16:42:23 
Re: Generic warning
Robert A Duff <bobduff  2008-06-18 11:10:29 
Re: Generic warning
"Dmitry A. Kazakov&q  2008-06-18 17:25:24 
Re: Generic warning
"Jeffrey R. Carter&q  2008-06-17 18:20:04 
Re: Generic warning
=?ISO-8859-1?Q?S=E9bastie  2008-06-18 08:55:39 
Re: Generic warning
"Ed Falis" <  2008-06-18 14:39:14 
Re: Generic warning
"Ed Falis" <  2008-06-18 15:38:01 
Re: Generic warning
"Dmitry A. Kazakov&q  2008-06-18 19:04:53 

Post A Reply:
  Go here to Signup

AddThis Feed Button


About - Advertising - Contact - Frequently Asked Questions - Privacy Policy - Terms of Use - Signup

Contact
tan12V112 Sat Sep 6 15:36:46 CDT 2008.