comp.lang.ada
 help / color / mirror / Atom feed
* Ada Function Return Values to C
@ 1996-07-04  0:00 Nigel J. Tracey
  1996-07-06  0:00 ` Robert Dewar
  0 siblings, 1 reply; 2+ messages in thread
From: Nigel J. Tracey @ 1996-07-04  0:00 UTC (permalink / raw)



Hi,

I have a simple Ada function which takes in a number of
parameters and calculates a DOUBLE result (from the
INTERFACES.C package) and then returns this. The problem
I'm having is that the value which gets back to the C
code (which called the Ada code) bares no relation to
the value calculated.

If I change the function to a procedure with an out
parameter and pass an address of a double in the C
routine which calls the Ada it all works fine! Returning
INTEGER values from the function also works perfectly!

Anybody have any ideas as to the problem, the
compiler is GNAT 3.05 and GCC 2.7.2 on Linux 1.2.13
Has anybody got GNAT to return FLOATS or DOUBLES back
to C routines?

Any help would be much appreciated.

Cheers,

	Nigel.





^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: Ada Function Return Values to C
  1996-07-04  0:00 Ada Function Return Values to C Nigel J. Tracey
@ 1996-07-06  0:00 ` Robert Dewar
  0 siblings, 0 replies; 2+ messages in thread
From: Robert Dewar @ 1996-07-06  0:00 UTC (permalink / raw)



Nigel asks about interfacing to C routines with Double and Float parameters.
This works just fine with GNAT, so it is probably a mistake on your part,
but may of course be a previously undetected GNAT problem.

Please send full sources illustrating what you think is the problem. Keep
the sources as short as possible, and include details on what system you
are using, what version of GNAT, what C compiler, and what you see and
what you expect to see, and send the report to report@gnat.com. You can
also send it to CLA if you like, which probably will help if it is your
problem (since someone can point it out), but probably won't help much
if it is a real GNAT bug, since we only accept bug reports via report@gnat.com

Robert Dewar
Ada Core Technologies





^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~1996-07-06  0:00 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
1996-07-04  0:00 Ada Function Return Values to C Nigel J. Tracey
1996-07-06  0:00 ` Robert Dewar

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