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,d92604885f078c76 X-Google-Attributes: gid103376,public From: kst@king.cts.com (Keith Thompson) Subject: Re: Passing Floats Ada->C Date: 1998/07/28 Message-ID: <901603579.642410@wagasa.cts.com>#1/1 X-Deja-AN: 375562754 Cache-Post-Path: wagasa.cts.com!kst@king.cts.com References: <35BCA22D.DB070D0F@email.mot.com> Organization: CTS Network Services Followup-To: comp.lang.ada Newsgroups: comp.lang.ada Date: 1998-07-28T00:00:00+00:00 List-Id: I've deleted comp.lang.c++ from the Newsgroups: header, since this isn't a C++ question. Matthew Heaney (matthew_heaney@acm.org) wrote: [...] > The problem I've had in the past is that Float in Ada sometimes means > something else in C, say long float. Make sure the underlying > representations are the same. > > If you're using Ada 95, you shouldn't have a problem if you stick to the > types in package Interfaces.C, and remember to use pragma Convention (C) > on your subprograms. Note that in C, if there's no prototype (or a ", ..." prototype) in scope, arguments of type float are promoted to type double. This is more likely to be a problem passing floats from C to Ada, but it's something to watch out for. As long as you properly prototype everything, it should seldom be an issue. -- Keith Thompson (The_Other_Keith) kst@cts.com <*> Qualcomm, San Diego, California, USA It takes a Viking to raze a village.