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-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,ac2397ce800de518 X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2001-09-05 22:20:02 PST Path: archiver1.google.com!newsfeed.google.com!newsfeed.stanford.edu!logbridge.uoregon.edu!dispose.news.demon.net!news.demon.co.uk!demon!pogner.demon.co.uk!zap!not-for-mail From: Simon Wright Newsgroups: comp.lang.ada Subject: Re: adasockets and adatypes Date: 04 Sep 2001 23:12:18 +0100 Organization: CodeFella Message-ID: References: <20010904115244.24236db3.tonygair@blueyonder.co.uk> <9n2lpb$c7b$1@nh.pace.co.uk> NNTP-Posting-Host: localhost X-NNTP-Posting-Host: pogner.demon.co.uk:158.152.70.98 X-Trace: news.demon.co.uk 999753556 nnrp-07:12319 NO-IDENT pogner.demon.co.uk:158.152.70.98 X-Complaints-To: abuse@demon.net NNTP-Posting-Date: 4 Sep 2001 22:12:19 GMT X-Newsreader: Gnus v5.7/Emacs 20.7 Xref: archiver1.google.com comp.lang.ada:12780 Date: 2001-09-04T22:12:19+00:00 List-Id: "Marin David Condic" writes: > Note that while I may complain about this from time to time, you're > still better off than you are with C in the same situation. In C you > have very little control over representation and in general just > have to rely on the fact that most C compilers choose to do things > basically the same way. The one advantage C has in this area is that > it is at least simpler to take just about any data structure and > treat it as raw bytes. You can get there in Ada, but it does require > more work. I would have thought the ideal non-automated C way of doing this would be to define a wire format that is convenient for manipulating endianness (eg, no packing) and manually stuff this on the way out/unstuff on the way in. Far less dangerous than trying to manipulate packed data. Sometimes the transport mechanism forces you to use the same length for every component -- eg, X properties, where you can choose 1/2/4 byte length and the server byteswaps for you.