[MLton] x86_64 branch on AIX

Ville Laurikari ville@laurikari.net
Thu, 6 Jul 2006 11:02:33 +0300

On Wed, Jul 05, 2006 at 10:25:29PM +0300, Ville Laurikari wrote:
> It seems that the system headers (or GCC headers?) on AIX are broken
> and have CHAR_MIN defined to 0, although `char' _is_ signed, at least
> with GCC.  I fixed this with
>   #undef CHAR_MIN
>   #define CHAR_MIN -128
> in aix.h, but I'm wondering if you guys can think of a better way?  Is
> that test really needed?  Are there actually places which assume that
> `char' is signed?

The above is incorrect.

On PowerPC/AIX, `char' is unsigned.  GCC treats this correctly, and
`char' is unsigned also with GCC.  I was mistaken to claim that GCC
treats `char' as signed on AIX.

The remaining problem then is that MLton seems to want that `char' is
signed.  At least cenv.h checks for this, and signals a compiler error
if CHAR_MIN is zero.

I can certainly coerce the runtime to compile on AIX by removing the
check for char signedness, but will something break?  The regression
tests pass, which leads me to suspect that the check is superfluous.