Discussion 解説
BOOL
is explicitly signed so @encode(BOOL)
is c
rather than C
even if -funsigned-char
is used.
For values, see Boolean Values.
Special Considerations 特別な注意事項
Since the type of BOOL
is actually char
, it does not behave in the same way as a C _Bool
value or a C++ bool value. For example, the conditional in the following code will be false on i386 (and true on PPC):
By contrast, the conditional in the following code will be true on all platforms (even where sizeof(bool) == 1
):