From: Nicola Muscettola
Subject: Calling C functions from AllegroCL
Date: 
Message-ID: <Buu2MH.388.2@cs.cmu.edu>
I am experiencing some very weird behavior while running an external C
routine from inside an AllegroCL fuction. I am running
version 3.1.12.2  on a DECstation 5000/200.
The external routine is a program (that I have not written) that executes a 
bunch of astronomical calculations (all in floating point, using "float" 
C types) and writes the results to a bunch of external files.  
When called from a C main program, the routine writes the correct results in
the files; however, when run from within Lisp, the routine does not
generate any correct results.

Initially, I had some trouble with passing float arguments to the C routine
from Lisp. The only float type that seems to be  correctly passed is the 'double-float. Since the C routine uses only floats, I changed the type of
the arguments of the C routine to "double"; I then casted them to float 
and assigned their value to  a bunch of "float" variables that
are then used in the calculations. I have verified that the
values of the casted float variables is correct when the C routine is called
from Lisp.

Does anybody have a clue of what is going on here?

-- Nicola Muscettola
   The Robotics Institute
   Carnegie Mellon University
   Pittsburgh, PA 15213