The return code from main using libsupcxx is not the same as calling exit, at least in linux-x86_64-libsupcxx . Specifically, sys::exit(1) (which calls the C function exit(1)) causes a shell exit status of 1, whereas "return 1;" from an initial call to main leads to a shell exit status of 0.
Note, the C standard says:
5.1.2.2.3 Program termination
- If the return type of the main function is a type compatible with int, a return from the
initial call to the main function is equivalent to calling the exit function with the value
returned by the main function as its argument.
The return code from main using libsupcxx is not the same as calling exit, at least in linux-x86_64-libsupcxx . Specifically, sys::exit(1) (which calls the C function exit(1)) causes a shell exit status of 1, whereas "return 1;" from an initial call to main leads to a shell exit status of 0.
Note, the C standard says:
5.1.2.2.3 Program termination
initial call to the main function is equivalent to calling the exit function with the value
returned by the main function as its argument.