[Vm-dev] egg sucking alert

David T. Lewis lewis at mail.msen.com
Thu Dec 11 01:48:25 UTC 2014


On Wed, Dec 10, 2014 at 03:13:13PM -0800, Eliot Miranda wrote:
>  
> Hi All,
> 
>     just a simple message about 64-bit code.  Don't use int.  Please use
> long, unsigned long, sqInt or usqInt for variables that are of the
> machine's natural word length (sqInt is a synonym for long and usqInt is a
> synonym for unsigned long).

No, sqInit is *NOT* a synonym for long.

In particular, it is a 64-bit data type in some circumstances, and a 32-bit
data type in others. Ditto for usqInt.

If you are working with something where word size matters, declare it as
such, and do not rely on sqInt and usqInt to do what you expect. They are
not 32 bit data types.

Some but not all of the plugins are 32/64 bit clean in trunk. But many,
including FFI, SSL, and plugins that rely on the SurfacePlugin stub, remain
to be sorted out. By far the worst problem is the assumption that C pointers
fit into 32-bit int data types, but there are various other issues remaining
to be addressed. At the risk of a broad generalization, they all relate to
missing type declarations and invalid assumptions about word size, such as
assuming that sqInt is 32-bits in size.

Dave



More information about the Vm-dev mailing list