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,4ef4bf3098ab117 X-Google-Attributes: gid103376,public X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news1.google.com!news1.google.com!news.glorb.com!border1.nntp.dca.giganews.com!nntp.giganews.com!newsfeed.cwix.com!news.binc.net!kilgallen From: Kilgallen@SpamCop.net (Larry Kilgallen) Newsgroups: comp.lang.ada Subject: Re: Ada compiler differences Date: 19 Oct 2004 09:49:53 -0500 Organization: LJK Software Message-ID: References: NNTP-Posting-Host: eisner.encompasserve.org X-Trace: grandcanyon.binc.net 1098197357 15740 192.135.80.34 (19 Oct 2004 14:49:17 GMT) X-Complaints-To: abuse@binc.net NNTP-Posting-Date: Tue, 19 Oct 2004 14:49:17 +0000 (UTC) Xref: g2news1.google.com comp.lang.ada:5457 Date: 2004-10-19T09:49:53-05:00 List-Id: In article , Mark H Johnson writes: > Magnus wrote: >> Or rather: how can I write code that really is platform (and compiler) >> independent in Ada? >> > To do that fully would require an extensive list of issues and is often > constrained by the types of platforms you expect to run on. For a simple > example, network order (for TCP/IP) is "big endian". If you are on a > little endian machine, several values need to go through htonl, htons, > and similar functions to be converted. If you "know" you will always on > a big endian machine (same as network order), you might get away without > them, but that isn't portable. > > That particular issue has nothing to do with Ada; you have the same > problem with C or other languages. In particular, it has to do with the fact that TCP/IP was devised on an ad-hoc basis rather than using an underlying marshalling technique such as promoted by ASN.1.