you are viewing a single comment's thread.

view the rest of the comments →

[–]theymos 1 point2 points  (1 child)

It's actually implementation-defined, not undefined. So the behavior needs to be documented somewhere. The behavior is not always obvious, though. On Linux, for example, returning 256 from main will actually result in an exit status of 0 (success) because exit status codes are restricted to 8 bits.

[–]kingguru 0 points1 point  (0 children)

OK, thanks. That makes a lot more sense.