[M3devel] C/Modula-3 interop with smaller than word/register parameters?

Jay K jay.krell at cornell.edu
Tue Dec 28 11:48:58 CET 2010


(same question for return values -- use INTEGER/ptrdiff_t instead of int?)

 - Jay

From: jay.krell at cornell.edu
To: m3devel at elegosoft.com
Subject: C/Modula-3 interop with smaller than word/register parameters?
Date: Tue, 28 Dec 2010 10:47:16 +0000








Are we super confident that passing an "int" (Ctypes.int) from Modula-3 to C will handle the upper bits correctly,
for systems with 64bit registers, register-passing calling conventions?

That is, zero or sign extended, if the ABI mandates it?

I realize, on the C side, the upper bits may or may not be ignored, depending on the ABI.

Maybe I'm being too paranoid.

Maybe I should stick to ptrdiff_t/INTEGER parameters?

 - Jay




 		 	   		  
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://m3lists.elegosoft.com/pipermail/m3devel/attachments/20101228/f42a6406/attachment-0002.html>


More information about the M3devel mailing list