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,f45ed6569ee60cb0,start X-Google-Attributes: gid103376,public From: njt@minster.york.ac.uk (Nigel J. Tracey) Subject: Ada Function Return Values to C Date: 1996/07/04 Message-ID: <836496628.0@cs.york.ac.uk>#1/1 X-Deja-AN: 163691082 organization: Dept. Computer Science, University of York. newsgroups: comp.lang.ada Date: 1996-07-04T00:00:00+00:00 List-Id: 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.