[Vm-dev] VMBIGENDIAN question (was: A proposal to split VMMaker into subpackages)

David T. Lewis lewis at mail.msen.com
Sat Mar 23 00:34:45 UTC 2013

On Sat, Mar 23, 2013 at 01:03:51AM +0100, Nicolas Cellier wrote:
> 2013/3/23 David T. Lewis <lewis at mail.msen.com>:
> No, you looked at the wrong function, it's intAtPointerput not intAtPointer
> And one has signed argument val and the other an unsigned.

Oops, sorry! 

> But never mind, it's not my day, my guess was totally wrong in this case because
> - 1) (b=c) has the type of b, not the type of c
> - 2) int = unsigned is not undefined behavior, it's just
> implementation defined and the compiler cannot eliminate a further <0
> test because the implementation is no-op bitwise.
> Before giving lessons in C, one should always turn tongue in cheeks ;)
> http://stackoverflow.com/questions/15581037/precedence-of-chained-assignments-and-casts


> By the way, I wonder the utility of (unsigned *) cast.
> It means than INT_MIN will be converted into UINT_MAX if sqInt is 64
> bits and int is 32 bit long.

There are a lot of places where integer casts are not properly defined
when sqInt is 64 bits. The 64 bit image works, but it would certainly
benefit from some additional development. For sure there should be a
clearer distinction between integers, object pointers, C pointers, and
32-bit words in the object memory. The type declarations should make
these explicit.

It would be a good project if someone wants to work on it.


More information about the Vm-dev mailing list