寺西です。

NOKUBI Takatsugu wrote:
> 
>   iconv_tの実体はvoid *で、C言語においてポインタできちんと定義されてい
> るのはNULLだけなので、-1を使うのは止めました。

(iconv_t)(-1) を使うことに何ら問題はありません。
iconv.h には以下のように書かれています。

The iconv_t type is a pointer type in all cases I have seen. (It
has to be a scalar type because (iconv_t)(-1) is a possible return value
from iconv_open().)

また man iconv_open にも以下のように書かれています。

RETURN VALUE
       The iconv_open function returns a freshly allocated conversion
descrip-
       tor. In case of error, it sets errno and returns (iconv_t)(-1).
-- 
=====================================================================
寺西 忠勝(TADAMASA TERANISHI)  
[メールアドレス保護]
http://www.asahi-net.or.jp/~yw3t-trns/index.htm
Key fingerprint =  474E 4D93 8E97 11F6 662D  8A42 17F5 52F4 10E7 D14E

_______________________________________________
Kakasi-dev mailing list
[email protected]
http://www.namazu.org/cgi-bin/mailman/listinfo/kakasi-dev

メールによる返信