【隔離】Cなら俺に訊け! Part.104【病棟】
SCHAR_MINがPOSIXでどうなってるのか、しらべてみた
、ところ
{SCHAR_MIN}
Minimum value of type signed char.
[CX] [Option Start] Value: -128 [Option End]
~~~
[CX][Option Start] Extension to the ISO C standard [Option End]
The functionality described is an extension to the ISO C standard.
Application writers may make use of an extension as
it is supported on all IEEE Std 1003.1-2001-conforming systems.
但し書きつきで、-128となっており、
~~~
may
Describes a feature or behavior that
is optional for an implementation that conforms to IEEE Std 1003.1-2001.
An application should not rely on the existence of the feature or behavior.
An application that relies on such a feature or behavior
cannot be assured to be portable across conforming implementations.
なんだか、必須条件ではないようなことが書いてあり、
~~~
Strictly Conforming POSIX Application
A Strictly Conforming POSIX Application is an application
that requires only the facilities described in IEEE Std 1003.1-2001.
Such an application:
...
7
For the C programming language,
shall not exceed any minimum implementation limit
defined in the ISO/IEC 9899:1999 standard, unless
the System Interfaces volume of IEEE Std 1003.1-2001 specifies
a higher minimum implementation limit.
~~~
Conforming POSIX Application
ISO/IEC Conforming POSIX Application
An ISO/IEC Conforming POSIX Application is an application
that uses only the facilities described in IEEE Std 1003.1-2001
and approved Conforming Language bindings
for any ISO or IEC standard.
POSIXに厳格に準拠するには、SCHAR_MIN == -127
ふつうに準拠するには、 -127 <= SHCAR_MIN <= -128
のようだ。