Yes, it can overflow like any other int .
The standard describes int with a width of at least 16 bits. Returning anything that does not match int is undefined behavior.
What the environment in which a C ++ program works, does with value, is an implementation defined and not described by the standard.
Three values ββare mentioned by the C ++ standard: EXIT_SUCCESS , EXIT_FAILURE and 0 . Both 0 and EXIT_SUCCESS indicate successful execution of the program, while the other indicates failure. EXIT_SUCCES not required to be zero.
Citation of the C ++ 11 standard:
If the status is zero or EXIT_SUCCESS, a status completion form is returned. If the status is EXIT_- FAILURE, the form for executing a status failure is returned. Otherwise, the return status is determined by the implementation .225
Supported regular values ββvary from implementation to implementation, Windows uses full 32-bit integers as return values, and full 32 bits can be obtained using various means. POSIX only defines how the low-order 8 bits can be obtained, and thus, shells often truncate return values.
source share