From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-1.3 required=5.0 tests=BAYES_00,INVALID_MSGID autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,ce5164dabf377317,start X-Google-Attributes: gid103376,public From: Al Johnston Subject: generic's and 'size... gnat bug? Date: 2000/03/10 Message-ID: <38C943B1.4D639ACB@mindspring.com>#1/1 X-Deja-AN: 595790165 Content-Transfer-Encoding: 7bit Organization: MindSpring Enterprises X-Accept-Language: en X-Server-Date: 10 Mar 2000 18:51:23 GMT Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 Newsgroups: comp.lang.ada Date: 2000-03-10T18:51:23+00:00 List-Id: 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.