Picking lint: should say (since it's greater than 2^15- 1).
So a compiler with 16-bit ints will see 40000 as a negative number because the function Max isn't using unsigned. A good compiler with warnings enabled should also warn about mixing signed and unsigned.
--
Mats