[Ecls-list] FFI: missing declaration garbles return value

Michael Wildpaner mike at rainbow.studorg.tuwien.ac.at
Mon Feb 13 05:55:05 UTC 2006


On Mon, 13 Feb 2006, Juan Jose Garcia Ripoll wrote:
> ECL always expected you to include the C headers for functions you link.
> I can fix this and include an option for automatically generating
> function declarations, but this should be optional, as the declarations
> created by the FFI will sometimes be incompatible with those of the
> headers (for instance, when your function uses pointers to structures).

That would be fine. As long as void* is assignment compatible with any 
other pointer type, properly declaring parameters and return type should 
be no regression to the current state.

Since ecl does not make gcc die on missing function definitions (and 
since, at least on i386, it works by chance for functions taking integers 
and any pointer type), this class of bugs is exceptionally hard to catch.

As per UFFI compatibility (full information for function declaration is 
there, no requirement for including headers of any kind), do you think 
that the automatic generation of function declarations should be the 
default behaviour?

Best wishes, Mike

-- 
If you don't breathe, there is no air.          DI Michael Wildpaner
If you don't walk, there is no earth.                  Ph.D. Student
If you don't speak, there is no world.
     -- Navajo (Dineh) wisdom




More information about the ecl-devel mailing list