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,FREEMAIL_FROM autolearn=ham autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,13f10cac2d21b84f X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2002-04-30 09:41:37 PST Path: archiver1.google.com!postnews1.google.com!not-for-mail From: robert_s_quinn@yahoo.com (Robert Quinn) Newsgroups: comp.lang.ada Subject: Re: Is this a GNAT bug??? Date: 30 Apr 2002 09:41:36 -0700 Organization: http://groups.google.com/ Message-ID: References: <3CC992D6.A87A3443@raytheon.com> <5ee5b646.0204291844.21d7f5f0@posting.google.com> NNTP-Posting-Host: 63.169.26.2 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 8bit X-Trace: posting.google.com 1020184897 10037 127.0.0.1 (30 Apr 2002 16:41:37 GMT) X-Complaints-To: groups-abuse@google.com NNTP-Posting-Date: 30 Apr 2002 16:41:37 GMT Xref: archiver1.google.com comp.lang.ada:23279 Date: 2002-04-30T16:41:37+00:00 List-Id: dewar@gnat.com (Robert Dewar) wrote in message > So the question is what set of rep clauses is implemented by a given compiler. > [snip] By staying within this subset you > achieve greater portability. Once you stray outside this subset, you are > writing non-portable code that is implementation dependent. It does not > mean that your code is nonsense, just that it may not be implemented. Well that makes sense and I appreciate your reply. I suppose if I needed this feature I could work something out with ACT. I guess the scenario I'm thinking of must not occur too frequently. I'll use specific numbers to make the example simple. Suppose you have a sequence of 12 bytes 94 bits). Suppose the first and last byte are header/tail info, leaving 10 bytes for data. Suppose 65 bits of the 10 bytes represent one kind of data, the remaining 13 bits another kind of data. It would be nice if you could convert this series of bytes into a record, for example of the form: type Message_Type is record Header_Data : Header_Data_Type; Data_Element_1 : Data_Element_1_Type; Date_Element_2 : Data_Element_2_Type; Tail_Data : Tail_Data_Type; end record; for Message_Type use record Header_Data at 0 range 0 .. 7; Data_Element_1 at 0 range 8 .. 72; Data_Element_2 at 0 range 73 .. 85; Tail_Data at 0 range 86 .. 93; end record; I could convert the sequence of bytes to an access type to this record. For example: type Message_Type_Access is access Message_Type; function Get_Message_Data is new Unchecked_Conversion (SOURCE => System.ADDRESS, TARGET => Message_Type_Access); So the way to handle this same situation with Gnat would be to NOT use the Unchecked_Conversion, but to make Data_Element_1 larger and just try to read the bits right out of memory into Data_Element_1. So reading a sequence of bits >= 65 bits out of memory is just always going to be more work since you cannot convert it directly into a type, right? Ok, I can accept this. Thanks for your insight, and for the etiquette pointers on posting. Please let me know if you have anything to add to my remarks. Robert Quinn