I'm getting warnings on this bit of core.ops when compiling with 64-bit
ints:

op write(i|ic, i|ic) {
  INTVAL * i = &($2);   /* <<<<---- */
  write($1, i, sizeof(INTVAL));
  goto NEXT();
}

I'm getting a warning that stems from the fact that sizeof(INTVAL) = 8 and
sizeof(opcode_t) = 4, so the pointer assignment (marked by the arrow) is
not valid/safe (unless I'm missing something).  Specifically, this applies
to the (i|ic, ic) forms of this op.

It'd probably be safer to do something like this:

op write(i|ic, i|ic) {
  INTVAL i = (INTVAL)$2;
  write($1, &i, sizeof(INTVAL));
  goto NEXT();
}

So that you can use constants that are up to sizeof(opcode_t) bytes, but
after that you're on your own.  That raises a question, though:  Do we
want to move integer constants into the constant table?

- D

<[EMAIL PROTECTED]>

Reply via email to