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,2203a21a136b39cc X-Google-Attributes: gid103376,public From: Simon Wright Subject: Re: Fortran's Equivalence Date: 1997/04/10 Message-ID: #1/1 X-Deja-AN: 232178792 X-NNTP-Posting-Host: pogner.demon.co.uk Sender: simon@pogner References: <333840D1.7B12@cae.ca> <3349165C.3B93@cae.ca> <1997Apr8.155111.26714@nosc.mil> <334BA679.5E5D@gsfc.nasa.gov> Organization: At Home Newsgroups: comp.lang.ada Date: 1997-04-10T00:00:00+00:00 List-Id: dewar@merv.cs.nyu.edu (Robert Dewar) writes: > Stephen says > > <> > > referring to the Bit_Order attribute representation clause. > > Well i appreciate the implied expectation that GNAT implemnts everything :-) > > But the Ada 95 language does not really expect this attribute definitoin > to be implemented for byte addressed machines, since it results in very > awkward non-contiguous fields. What worked for me was given an interfaces.c.int to be interpreted as bit fields declare record type without representation declare variable "result" of this type if system.default_bit_order = system.high_order_first then declare derived record type with big-endian representation do unchecked conversion from interfaces.c.int to this type assign to "result" else declare derived record type with little-endian representation do unchecked conversion from interfaces.c.int to this type assign to "result" end if which is long-winded but does the job! No doubt there are other ways .. -Simon