【◆QZaw55cn4c 隔離】C/C++の問題を片付けますat TECH
【◆QZaw55cn4c 隔離】C/C++の問題を片付けます - 暇つぶし2ch282:デフォルトの名無しさん
10/12/03 10:15:43
>>279
C99の規格票で済まないがこんな項目がある

26 A pointer to void shall have the same representation and alignment requirements as a
pointer to a character type.39) Similarly, pointers to qualified or unqualified versions of
compatible types shall have the same representation and alignment requirements. All
pointers to structure types shall have the same representation and alignment requirements
as each other. All pointers to union types shall have the same representation and
alignment requirements as each other. Pointers to other types need not have the same
representation or alignment requirements.

この規格票から見れば、void * に対する演算は、char * に対する演算と等価だと言っている。
だからBCCがおかしいと言えない事もない。

ちなみにgcc 4.5.1に-ansiを付けてコンパイルしてもコンパイルは通る
gccが正しいのなら、BCCが規格通りではない(C89はどうだが知らないが)という事になる


次ページ
続きを表示
1を表示
最新レス表示
レスジャンプ
類似スレ一覧
スレッドの検索
話題のニュース
おまかせリスト
オプション
しおりを挟む
スレッドに書込
スレッドの一覧
暇つぶし2ch