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.9 required=5.0 tests=BAYES_00 autolearn=ham autolearn_force=no version=3.4.4 X-Google-Thread: 103376,dd41b5654bd378e7 X-Google-Attributes: gid103376,public,usenet X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news2.google.com!news3.google.com!feeder3.cambrium.nl!feeder2.cambrium.nl!feed.tweaknews.nl!193.201.147.84.MISMATCH!xlned.com!feeder1.xlned.com!news-out2.kabelfoon.nl!newsfeed.kabelfoon.nl!xindi.nntp.kabelfoon.nl!sn-xt-ams-06!sn-xt-ams-03!sn-post-ams-02!sn-post-sjc-01!supernews.com!corp.supernews.com!not-for-mail From: Vincent Marciante Newsgroups: comp.lang.ada Subject: Re: Representation item appears too late Date: Fri, 26 Oct 2007 00:08:18 -0400 Organization: Posted via Supernews, http://www.supernews.com Message-ID: <47216832.54B2@earthlink.net> X-Mailer: Mozilla 3.0 (OS/2; I) MIME-Version: 1.0 References: <87640vgvvl.fsf@ludovic-brenta.org> Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Complaints-To: abuse@supernews.com Xref: g2news2.google.com comp.lang.ada:2572 Date: 2007-10-26T00:08:18-04:00 List-Id: Ludovic Brenta wrote: > > Consider the following declarations: > > package A is > > type Size is (Small, Large); > > type Foo is range 1 .. 8; > > type T is record > A : Boolean; > B : Boolean; > C : Boolean; > D : Size_Type; > E : Foo; > end record; > > procedure P (X : in T); -- a null procedure for the sake of example > > end A; > > with A; > package B is > > type T is new A.T; > for T use record -- line 5 > A at 0 range 0 .. 0; > B at 0 range 1 .. 1; > C at 0 range 2 .. 2; > D at 0 range 3 .. 3; > E at 0 range 4 .. 7; > end record; > > end B; > > Compiling B with GCC 4.1 I get: > > gcc-4.1 -c -g -O2 -gnatafnoy -gnatVa -gnatwa -I- -gnatA /home/lbrenta/src/ada/b.ads > b.ads:5:04: representation item appears too late > b.ads:5:04: primitive operations already defined for "T" > gnatmake: "/home/lbrenta/src/ada/b.ads" compilation error > > This also happens with GCC 4.2. How about: package A is type Size is (Small, Large); type Foo is range 1 .. 8; package Base is type T is record A : Boolean; B : Boolean; C : Boolean; D : Size; E : Foo; end record; end Base; type T is new Base.T; procedure P (X : in T); -- a null procedure for the sake of example end A; with A; package B is type T is new A.Base.T; for T use record -- line 5 A at 0 range 0 .. 0; B at 0 range 1 .. 1; C at 0 range 2 .. 2; D at 0 range 3 .. 3; E at 0 range 4 .. 7; end record; end B; Vinny --