C言語なら俺に聞け(入門編)Part 78
■ このスレッドは過去ログ倉庫に格納されています
0622デフォルトの名無しさん
2011/02/12(土) 21:41:44§6.3.2.2.
5 An integer may be converted to any pointer type. Except as previously specified, the
result is implementation-defined, might not be correctly aligned, might not point to an
entity of the referenced type, and might be a trap representation.56)
56)56) The mapping functions for converting a pointer to an integer or an integer to a pointer are intended to
be consistent with the addressing structure of the execution environment.
該当する部分JIS X3014
任意のポインタ型は整数型に型変換できる。これまでに規定されている場合を除き、
結果は処理系定義とする。結果が整数型で表現できなければ、その動作は未定義とする。
結果は何らかの整数型の値の範囲に含まれているとは限らない。
56)ポインタを整数型に変換する関数、又は整数をポインタに変換する関数は、実行環境に
おけるアドレス構造に関して一貫した動作をするように作られている。
--------------------------------------------------------------------
これのうち「結果が整数型で表現できなければ、その動作は未定義とする。」がこの場合は大事
LLP64LP64が未定義となるので注意
■ このスレッドは過去ログ倉庫に格納されています