http://www.open-std.org/jtc1/sc22/wg14/www/docs/n1124.pdf#page=193 [open-std.org] > In all cases the argument is an int, the value of which shall be representable as an unsigned char or shall > equal the value of the macro EOF. If the argument has any other value, the behavior is undefined. EOF以外の負の値をisXXXXに渡すと鼻から悪魔が出るみたいなので、処理系に範囲チェックの義務はないようです。
ISO/IEC 9899:1999 § 7.4.より (スコア:0)
http://www.open-std.org/jtc1/sc22/wg14/www/docs/n1124.pdf#page=193 [open-std.org]
> In all cases the argument is an int, the value of which shall be representable as an unsigned char or shall
> equal the value of the macro EOF. If the argument has any other value, the behavior is undefined.
EOF以外の負の値をisXXXXに渡すと鼻から悪魔が出るみたいなので、処理系に範囲チェックの義務はないようです。
Re:ISO/IEC 9899:1999 § 7.4.より (スコア:1)
あー・・・やっぱ仕様なんですね。
わざわざ調べてくれてありがとうございます。
間違えててもクラッシュしないケースが多そうなだけに、間違えている人間がどれだけ居るのか想像もつかない…
そしてEOF(-1)は大丈夫なんですね。
そういえば411130もxxxxxxx2とか一個ずれた場所をポイントしてましたがアレはEOFだったのか!
本文修正しました。