Michael Veksler wrote:
Most programmers "know" that arithmetic is modulo wordsize. And those few
who know the right answer (only unsigned arithmetic is modulo) will
from time to time slip up and omit the "unsigned" keyword in their
declarations.
I agree.
Although the standard clearly makes signed overflow undefined, I think
it would be better if GCC defined it to be modulo arithmetic. The
degree to which that would result in inferior code seems likely to be
somewhat small, and the amount of user confusion we would eliminate, and
the number of programs that would not break with GCC, even though they
work with other compilers, seems likely to be high.
--
Mark Mitchell
CodeSourcery, LLC
[EMAIL PROTECTED]
(916) 791-8304