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,start X-Google-Attributes: gid103376,public,usenet X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news2.google.com!news3.google.com!proxad.net!feeder1-2.proxad.net!62.111.101.3.MISMATCH!news.germany.com!newsfeed.kamp.net!newsfeed.kamp.net!feeder3.cambrium.nl!feeder5.cambrium.nl!68.142.88.75.MISMATCH!hwmnpeer01.ams!news.highwinds-media.com!news.astraweb.com!border2.a.newsrouter.astraweb.com!feeder2.cambrium.nl!feed.tweaknews.nl!not-for-mail From: Ludovic Brenta Newsgroups: comp.lang.ada Subject: Representation item appears too late Date: Thu, 25 Oct 2007 15:35:26 +0200 Message-ID: <87640vgvvl.fsf@ludovic-brenta.org> User-Agent: Gnus/5.110006 (No Gnus v0.6) Emacs/21.4 (gnu/linux) Cancel-Lock: sha1:X3scbr0XTtoYRGe8jq8DkTqeDi0= MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Organization: Tele2 X-Trace: DXC=lj0:acPY4XflN]RWbE^ 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. Of course, removing procedure A.P also removes the error but this is not an option. What should I do to specify a representation clause? Do I have to resort to declaring a mirror type in B? Why? Thanks for any advice. -- Ludovic Brenta.