On 3/13/06, Xavier Leroy <Xavier.Leroy@inria.fr> wrote:
You haven't declared caml_alloc (include <caml/alloc.h>), so the C
compiler assumes it returns an int instead of a value, and generates
wrong code.
Funny that I didn't spot this one. Good to know that one should
look out for this problem when making sure that code remains portable
to 64-bit machines.
I think C-compilers should by default issue a warning on platforms
where the size of int may be different from the size of a pointer
instead of silently inventing a function prototype that is very likely
to crash.
Regards,
Markus