comp.lang.ada
 help / color / mirror / Atom feed
From: kst@king.cts.com (Keith Thompson)
Subject: Re: Passing Floats Ada->C
Date: 1998/07/28
Date: 1998-07-28T00:00:00+00:00	[thread overview]
Message-ID: <901603579.642410@wagasa.cts.com> (raw)
In-Reply-To: m34sw3ufye.fsf@mheaney.ni.net

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 <http://www.ghoti.net/~kst> <*>
Qualcomm, San Diego, California, USA  <http://www.qualcomm.com>
It takes a Viking to raze a village.




      reply	other threads:[~1998-07-28  0:00 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1998-07-27  0:00 Passing Floats Ada->C Dennis Miller
1998-07-27  0:00 ` Rick Stikkers
1998-07-28  0:00 ` Matthew Heaney
1998-07-28  0:00   ` Keith Thompson [this message]
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox