[MLton] C-types
Matthew Fluet
fluet@cs.cornell.edu
Sat, 13 May 2006 11:57:33 -0400 (EDT)
> I do plan on fixing the signedness issue for the use of C-types in the Basis
> Library, although it probably won't be this evening.
>
> I believe that the c-types.sml files are being generated properly -- namely,
> with the sizes and signedness of the target system. So, people should feel
> free to check in
> basis-library/config/c/$(TARGET_ARCH)-$(TARGET_OS)/c-types.sml
>
> The 'vision' is to develop a signature of operations that may be applied to C
> integer types, which, like C, applies to types of any signedness.
I've exposed a few more coercions to and from SysWord.word in the
INTEGER_EXTRA signature, which fixes most of the signedness issues. I can
compile x86-mingw, with the signedness if ino_t restored. The remaining
issue is that MLTON_RLIMIT exposes the rlim_t type as WORD, which is
consistent with the POSIX specs, which state that rlim_t is an unsigned.
However, the BSD variants (darwin, freebsd) purposefully define rlim_t as
a signed integer, for compat. with legacy code that uses -1 for infinity.
Suggestions on how to pass rlim_t up to ML user code in a portable manner?