Thomas Lumley said:
<snip>
With unsigned int the optimization would not be permitted, since the
behaviour on overflow is defined and implies a return value of 0.
Not quite a correct explanation. The C Standard does not define the
behaviour of unsigned ints on overflow. Rather, it specifies unsigned
integer arithmetic in such a way that overflow is impossible.
Your description of the outcome, however, is correct.
--
Richard Heathfield <http://www.cpax.org.uk>
Email: -www. +rjh@
Google users: <http://www.cpax.org.uk/prg/writings/googly.php>
"Usenet is a strange place" - dmr 29 July 1999