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,5ae752c88e0dde5e X-Google-NewGroupId: yes X-Google-Attributes: gida07f3367d7,domainid0,public,usenet X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news1.google.com!news3.google.com!proxad.net!feeder1-2.proxad.net!newsfeed.straub-nv.de!eternal-september.org!feeder.eternal-september.org!.POSTED!not-for-mail From: Simon Wright Newsgroups: comp.lang.ada Subject: Re: Using representation clauses in networking software Date: Sun, 15 Aug 2010 20:15:49 +0100 Organization: A noiseless patient Spider Message-ID: References: <8739ugqfeb.fsf@mid.deneb.enyo.de> <43fkp7an4c5m$.3db3n6adym42.dlg@40tude.net> <8739ugkka6.fsf@mid.deneb.enyo.de> <1pjh30gv98n9t$.lycfvhr1l9rz$.dlg@40tude.net> <87tymvhoy5.fsf@mid.deneb.enyo.de> <1x3jdyxqnl1e7.xlqx0giurt0x.dlg@40tude.net> <1uzfyshtk9wpq.1ft0ehpgbw60k.dlg@40tude.net> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Injection-Date: Sun, 15 Aug 2010 19:15:50 +0000 (UTC) Injection-Info: mx02.eternal-september.org; posting-host="KCXegvZb5vh43D+f3BR6Ew"; logging-data="11787"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1//BmpAZRxA6bxLnv5AtudoNdICfcjHIJI=" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.2 (darwin) Cancel-Lock: sha1:ayoYLfNfswD458utdxyDULzzNas= sha1:yL/sPbeIgzQvFK9o73EXlVl0JFU= Xref: g2news1.google.com comp.lang.ada:13356 Date: 2010-08-15T20:15:49+01:00 List-Id: "Dmitry A. Kazakov" writes: > When using representation clauses? In order to use them you have two > parameters in the equation: the internal endianness and external > endianness. How can it be statically independent on the former (=portable)? > Well, with conditional expressions of Ada 201X, maybe, it could be possible > to describe. But I don't want to be one to maintain that mess. I'd better > stick to good old means. Yes, indeed. Stick to network-byte-order on the wire, define messages explicitly, preferably with a pictorial representation that is extremely clear as to which byte is sent in which order and how this corresponds to machine storage. I don't think you can take too much trouble with specifying any sort of interface; endianness differences just make matters more critical.