3 ms·
> The author of this document proposes restricting user-defined exit codes to the range 64 - 113 (in addition to 0, for success), to conform with the C/C++ stan
by _kst_ 5y ago
> The author of this document proposes restricting user-defined exit codes to the range 64 - 113 (in addition to 0, for success), to conform with the C/C++ standard.
The C and C++ standards don't say anything that suggests reserving the range 64-113.
Here's what the C standard says:
> If the value of status is zero or EXIT_SUCCESS, an implementation-defined form of the status successful termination is returned. If the value of status is EXIT_FAILURE, an implementation-defined form of the status unsuccessful termination is returned. Otherwise the status returned is implementation-defined.
C++ inherits C's specification.
EXIT_SUCCESS is (almost?) always defined as 0. EXIT_FAILURE is usually defined as 1 (but not on OpenVMS, where the OS defines 1 as a form of success).
The restriction to 8-bit values is POSIX, not C or C++.