On Feb 16, 2006, at 19:24, Andy Dougherty wrote:
sizeof(opcode_t) != sizeof(void*) is for sure broken.
Well, it used to work, but that was a long time ago. Configure
actually
tests for this case and still claims it will work; perhaps that test
should be changed to emit a much more dire message, or even die (unless
overridden).
It's not really easy to state, which type combinations are valid,
because the combinations depend on other config options. Given that
current type abuse in parrot were fixed, we'd have these constraints:
sizeof(opcode_t) >= sizeof(INTVAL) [1]
sizeof(void *) >= sizeof(INTVAL) [2]
[1] We are storing INTVAL constants in the opcode stream directly.
Moving INTVAL constants into the constant table or decode INTVAL
constants with more than one opcode would fix that
[2] The direct threaded run core (CGP) is using labels as values, which
are 'void *' according to 'info gcc'. The prederefed opcode stream also
contains INTVAL constants.
If the C compiler doesn't provide this feature there is still the
prederefed switched runcore where a mix of (opcode_t, INTVAL, and
void*) is in the opcode stream, but that could be a max-sized type
probably.
I hope that makes some sense,
leo