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.3 required=5.0 tests=BAYES_00,INVALID_MSGID autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,ef667ac6a3e5446b X-Google-Attributes: gid103376,public From: fea Subject: Re: Sun Ada 3.0 / 2.1.1 Date: 1999/05/24 Message-ID: <3748CEEB.9815A4F5@gateway.net>#1/1 X-Deja-AN: 481383328 Content-Transfer-Encoding: 7bit References: <37408CC0.5E601B20@sll.northrop.com> X-Sender: "fea" (Unverified) Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 Newsgroups: comp.lang.ada Date: 1999-05-24T00:00:00+00:00 List-Id: David C. Hoos, Sr. wrote: > > Guy Calinsky wrote in message > news:37408CC0.5E601B20@sll.northrop.com... > > > > I have a requirement to upgrade my project's compiler from Sun Ada 2.1.1 > > to Sun Ada 3.0. > > Easy enough, except that my application makes several calls to C > > functions, passing floating point numbers. > > Whereas my application worked fine under 2.1.1, the floating point > > numbers are not mapping correctly between 3.0 and C and I get junk for > > results. Does anybody know why this is? > > Sun and Rational are being difficult. > > > My guess would be that your code has interfaces to C based on types from > the compiler's package Standard which have changed size. > > For example, I remember that VADS on the SGI IRIX platform changed > their type Float from 32-bit to 64-bit, and the Oracle interface was > based on equating C float to VADS Float, and C double to VADS Long_Float. > > You should have your own project-specific types of fixed size, to protect > yourself from compiler changes. > My project had the same requirement as you do and encountered the same problem. David's guess is 100% correct. In Sun 2.1.1 "Float" is the same size as "Long_Float." In Sun 3.0, its size changed to that of "Short_Float." While the correct solution is to isolate the dependency with a user defined type, our project didn't have time in the schedule for that. We found all the instances of "Float," changed them to "Long_Float," and everything, including our C interface, worked fine and made the delivery.