[MLton] The evils of importing as 'extern'

Wesley W. Terpstra wesley@terpstra.ca
Thu, 25 May 2006 13:32:33 +0200


The regression suite passed in entirety. It didn't even mess up float  
rounding or allocation sizes, which seems odd, but ok! :-)

On May 25, 2006, at 3:51 AM, Matthew Fluet wrote:
>> With the attached patch, I've completed a full build of MLton, and  
>> am most of the way through the regression suite without event. I'm  
>> going to sleep now, but if something goes wrong, I'll post it here  
>> tomorrow. Let me know if you think the patch is ok to commit.
>
> I think the patch looks great.

Committed.

> After that patch, we can add "basis-ffi.h" to "c-chunk.h" and  
> revise the MLTON_CODEGEN_WORDSQUOTREM macro.  (There won't be any  
> need for the C-codegen to generate the declaration.)

I haven't done this, as I'm uncertain what you mean about the c- 
codegen generating the declaration..?

I can confirm that fixed-integer did pass with your changes + the  
typed extern (didn't rebuild mlton-compile).

> the C-codegen should emit a type-decorated extern for _symbol  
> objects, but should emit an undecorated extern for _address objects.

This is what my patch does (hence CType.t option).

> If you want to peek and poke at an object at different C-types,  
> then you need to get it via _address an construct your own getter/ 
> setter functions with MLton.Pointer.* functions.

Ahh. You're right. So users can still shoot themselves in the foot!  
Excellent! =D

>>>> ../runtime/basis-ffi.h:1005: warning: 'WordS16_quot' used but  
>>>> never defined
>>>> ../runtime/basis-ffi.h:1006: warning: 'WordS16_rem' used but  
>>>> never defined
>
> I think I fixed this as part of r4581.

They're gone.

I'm declaring ppc/osx as completely working, and moving on to ppc/linux.