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, MSGID_RANDY autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,96eed9f3fe0e5887 X-Google-Attributes: gid103376,public From: dennison@telepath.com Subject: Re: Yet another gnat/TFFE difference Date: 1999/05/22 Message-ID: <7i6n1h$pk8$1@nnrp1.deja.com>#1/1 X-Deja-AN: 480895984 References: <7i4vjh$n4t$1@nnrp1.deja.com> X-Http-Proxy: 1.0 x22.deja.com:80 (Squid/1.1.22) for client 204.48.27.130 Organization: Deja.com - Share what you know. Learn what you don't. X-Article-Creation-Date: Sat May 22 16:46:41 1999 GMT Newsgroups: comp.lang.ada X-Http-User-Agent: Mozilla/4.6 [en] (WinNT; I) Date: 1999-05-22T00:00:00+00:00 List-Id: In article , Keith Thompson wrote: > dennison@telepath.com writes: > > Gnat has no problem with this, which makes sense as the slices are the > > same size and the base type of the arrays are the same. > > I think you mean element type, not base type. Correct. > > > TFFE compilers blow up with a constrataint error here. I'm gessing that > > is because objects of type T2 have to be 5 elements long, but my slice > > is 2 elements. > > A conversion to subtype T2 includes a constraint check against T2's > bounds, 1..5, so the Constraint_Error is correct. > > > I have two questions here: First off, which vendor gets the bug > > report? :-) > > Probably neither one. I just tried this with GNAT 3.11p, and it did > raise Constraint_Error. Hmmm. You're right. However, I have some code which does just that, except that the type ranges and the slice ranges are computed at runtime. Gnat lets that by no problem, but two separate TFFE compilers choke on it. It looks like I *might* have a gnat bug here, but I'm going to have to find some time to play with my toy example to be sure. > You're doing an array subtype conversion; what you want is an array > base type conversion. The problem is, the base types are anonymous. > Here's something that should do what you want: > > type UT1 is array(Positive range <>) of Float; > subtype T1 is UT1(1..2250); > O1 : T1; > > type UT2 is array(Positive range <>) of Float; > subtype T2 is UT2(1..5); > O2 : T2; Hmmm...or perhaps I could just make one parent type for both of them... Thanks. -- T.E.D. --== Sent via Deja.com http://www.deja.com/ ==-- ---Share what you know. Learn what you don't.---