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=-0.8 required=5.0 tests=BAYES_00,INVALID_DATE autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,5c884986b9e56484 X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 1994-09-22 07:14:39 PST Path: bga.com!news.sprintlink.net!howland.reston.ans.net!europa.eng.gtefsd.com!MathWorks.Com!news.duke.edu!eff!blanket.mitre.org!linus.mitre.org!linus!mbunix!eachus From: eachus@spectre.mitre.org (Robert I. Eachus) Newsgroups: comp.lang.ada Subject: Re: Transition from 32 to 64 bit Date: 21 Sep 94 09:05:54 Organization: The Mitre Corp., Bedford, MA. Message-ID: References: <1994Sep20.160716.25347@relay.nswc.navy.mil> NNTP-Posting-Host: spectre.mitre.org In-reply-to: wbdavis@shooter.nswc.navy.mil's message of Tue, 20 Sep 1994 16:07:16 GMT Date: 1994-09-21T09:05:54+00:00 List-Id: In article <1994Sep20.160716.25347@relay.nswc.navy.mil> wbdavis@shooter.nswc.navy.mil (Bill Davis) writes: > I have a large program written in Ada which currently runs on a > 32 bit MIPS machine. I have been requested to move this software > to a 64 bit SGI machine. We are running Verdix compilers on both > machines. I am having trouble because on the MIPS the float type > is 32 bits and the long_float is 64 bits. On the SGI machine the > float is 64 bits and the short_float is 32 bits. Is there any way > to get this software running without actually changing all the > floats to short_floats and the long_floats to floats in the source > code. If anyone has any suggestions, I would like to hear them. Okay: 1) Use a different compiler. 2) Create a package that defines: type Long_Float is new Standard.Float; type Float is new Standard.Short_Float; and in every library unit that uses Float or Long_Float put in a with clause and renames of the types (so they will hide the types from Standard). 3) Get your compiler vendor to provide you with an alternate package STANDARD. (Not as silly as it sounds, with many compilers this is a reasonable option. 4) Modify the source to use, say Float_6 and Float_14, declared in terms of the actual required precision. Then the port becomes easy, and no source changes are required. The last solution is, of course, the one taught to all Ada programmers, so I assume that you are aware of it (and that someone else wrote the offending software). It may not seem like an astonishing revelation that software written non-portably is not portable, but there are a lot of managers out there who still haven't figured it out. Since confession is good for the soul, I should point out that on the ADAR project, where portablity is job one, everyone has made the mistake of using Integer or Float in inappropriate places at one time or another. But we treat such occurances as serious bugs. (There are some places where you must use the standard types, and others where they are used to match other standards, so there are places where Integer and Float are used.) -- Robert I. Eachus with Standard_Disclaimer; use Standard_Disclaimer; function Message (Text: in Clever_Ideas) return Better_Ideas is...