What are the rules on declaring integers?

Signed integer overflow is undefined behavior. It may happen to roll over but this should not be counted on. There actually is a way to make it not undefined behavior:

Unsigned integer rollover is not undefined behavior so I think the change to an unsigned type in the example is an improvement. Maybe it would be worth adding an explanation about signed overflow being UB to that page.

My suggestions have already been accepted. Pretty impressive response time from Arduino! Thank you olf2012 for pointing out that page needed some work and Coding Badly for the improvement. The world is now a very slightly better place.