[MLton] Type cleanup for 64bit port (was: sparc works)
Thu, 23 Dec 2004 12:25:42 -0800
> > > I suppose you could define Pid, Uid, Time, Size, etc to be the smallest
> > > SML compiler supported type larger than pid_t, uid_t, time_t, size_t, etc.
> > Sounds good to me.
> I'm still uncomfortable with this.
> If we take this approach we should be very disciplined in the runtime to
> immediately cast the parameter to the correct C type. Otherwise, macros
> and variable-argument functions may run amock.
This makes perfect sense.
It might be good to put asserts somewhere in the runtime that verify
our assumptions about the relationships between SML types and C types.
For example, right now we would write
assert (sizeof (pid_t) == sizeof (Pid));
and once we sanitize the runtime code as you did for waitpid we would
change that to
assert (sizeof (pid_t) <= sizeof (Pid));