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=0.2 required=5.0 tests=BAYES_00,INVALID_MSGID, REPLYTO_WITHOUT_TO_CC autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,e977cd3ab4e49fef X-Google-Attributes: gid103376,public From: rgilbert@polaris.orl.mmc.com (Bob Gilbert) Subject: Re: Question about record rep spec placement Date: 1997/01/15 Message-ID: <5bjag6$k7d@zeus.orl.mmc.com>#1/1 X-Deja-AN: 210028227 references: <32DCFDAA.2656@lmtas.lmco.com> organization: Lockheed Martin E&M reply-to: polaris.orl.mmc.com newsgroups: comp.lang.ada Date: 1997-01-15T00:00:00+00:00 List-Id: In article <32DCFDAA.2656@lmtas.lmco.com>, Ken Garlington writes: > We have some Ada83 code that looks like the following: > > package Some_Package is > > type Some_Record is record > -- components here > end record; > > -- some arbitrary declarations here > > private > > for Some_Record use record > -- component rep spec here > end record; > > end; > > Are there cases in Ada where a record representation specification > cannot be deferred until the private part of the package? I'm told that > when this code was compiled with an Ada 95 compiler, that the record > rep spec had to be moved to immediately after the record declaration > for the code to compile correctly. I'm wondering if this is > > (a) illegal Ada83 code that our Ada83 compiler accepted anyway > (much like the use of unchecked_conversion on the left-hand side > of an assignment statement, as described in another thread), > > (b) legal Ada code that the other Ada compiler rejected anyway, or > > (c) OUCH! Ada83 code that is no longer valid Ada. I'm pretty sure (a) is the answer (a representation clause must occur in the same declaration list as the entity it refers to, and I believe that the private section constitutes a different declaration list), but regardless.... What possible purpose would placing the record rep spec in the private section serve when the record is not a private type? -Bob