Version française
Home     About     Download     Resources     Contact us    

This site is updated infrequently. For up-to-date information, please visit the new OCaml website at

Browse thread
Caml interface with C on x86_64
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: -- (:)
From: Markus Mottl <markus.mottl@g...>
Subject: Re: [Caml-list] Allocating caml lists from C : possible bug on amd64
On 3/13/06, Xavier Leroy <> 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

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.