Martin Frb wrote:
What is supposed to happen if the 2nd argument is negative?
I would propose to document it as "undefined behaviour", just like C does (http://www.open-std.org/jtc1/sc22/wg14/www/docs/n1124.pdf , section 4.5.7). The reason is that the behaviour can differ depending on the cpu, so if you want to guarantee consistent behaviour on all platforms, you can no longer just emit a shift left/right instruction and have to add all kinds of checks.
Maybe we should support emitting range checks for the right operand though (to give an error if it falls outside the range of shift values whose behaviour is defined).
Jonas _______________________________________________ fpc-devel maillist - [email protected] http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-devel
