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!news2.google.com!news.maxwell.syr.edu!newsfeed.us.prserv.net!prserv.net!cyclone.swbell.net!bos-service1.raytheon.com!dfw-service2.ext.ray.com.POSTED!53ab2750!not-for-mail From: Mark H Johnson User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.4) Gecko/20030624 Netscape/7.1 (ax) X-Accept-Language: en-us, en MIME-Version: 1.0 Newsgroups: comp.lang.ada Subject: Re: Ada compiler differences References: In-Reply-To: Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit Message-ID: Date: Mon, 18 Oct 2004 16:48:38 -0500 NNTP-Posting-Host: 192.27.48.106 X-Complaints-To: news@ext.ray.com X-Trace: dfw-service2.ext.ray.com 1098136118 192.27.48.106 (Mon, 18 Oct 2004 16:48:38 CDT) NNTP-Posting-Date: Mon, 18 Oct 2004 16:48:38 CDT Organization: Raytheon Company Xref: g2news1.google.com comp.lang.ada:5419 Date: 2004-10-18T16:48:38-05:00 List-Id: Magnus wrote: > Hello, > > Could someone please point me to a list of things that may be > implementation dependent in different ADA compilers and/or on > different platforms? > I would start with chapter 13 of the Ada Reference Manual. Simple things like Integer'Size (e.g., 32) might not equal Natural'Size (e.g., 31) can trip you up in a variety of different ways. I also had problems with some code assuming 'Size of the object was the same as 'Size of the corresponding type. I would also suggest a review of the Annotated ARM as well. The annotations are quite enlightening when trying to determine the possible implementation details of the language. > I know that things like 'access and structures without repspec may > differ. But what else? > See above. > 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. --Mark