[MLton] a better c-types.h?

Matthew Fluet fluet@cs.cornell.edu
Sun, 25 Jun 2006 10:02:22 -0400 (EDT)


> It seems to me that c-types.h could be platform dependent, if instead
> of automatically generating a typedef like
>
>  typedef /* dev_t */ Word64_t C_Dev_t;
>
> we simply generated
>
>  typedef dev_t C_Dev_t;
>
> Are there any problems with this?  It seems like a clear win to me.

I think it would be o.k. to do the direct typedef.  The (minor) advantage 
of the indirect typedef is that it ensures that any cast between Word64_t 
and dev_t are handled by the C compiler, and never by the calling 
convention.  As long as all of the C types are {Int,Word}{8,16,32,64}, 
then there shouldn't be a problem.