comp.lang.ada
 help / color / mirror / Atom feed
From: Al Johnston <sofeise@mindspring.com>
Subject: generic's and 'size... gnat bug?
Date: 2000/03/10
Date: 2000-03-10T18:51:23+00:00	[thread overview]
Message-ID: <38C943B1.4D639ACB@mindspring.com> (raw)

I have some code that I am porting that looks like this
assume
   subtype foo_id is natural;

generic
    type foo_gentype is (<>);
package some_package  is
    procedure some_routine;
end some_package;

package body some_package is
    procedure some_routine is
        function to_footype is new
unchecked_conversion(foo_gentype,foo_id);
        my_foo_gentype : foo_gentype;
        my_foo_id : foo_id_type;
    begin
        my_foo_id := to_footype(my_foo_gentype)
    end some_routine;
end some_package;

which is inst'd as
    package my_foo_pkg is new some_package(foo_id_type);

My problem: compile warning pointing to the line above; but addressing
the unchecked_conversion between foo_gentype and foo_id.  it says
foo_gentype'size is 32 and foo_id_type'size is 31.  I have run across
the "fact" that a natural uses 31 bits in gnat(linux/x86), but why does
the compiler think/use the value of 32 for the generic type?

is a bug?  or is this a language "feature"

thanks.





             reply	other threads:[~2000-03-10  0:00 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2000-03-10  0:00 Al Johnston [this message]
2000-03-10  0:00 ` generic's and 'size... gnat bug? Al Johnston
2000-03-14  0:00 ` Al Johnston
replies disabled

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