【ISO/ANSI/JIS】 C言語なら俺に聞け! Part 132at TECH
【ISO/ANSI/JIS】 C言語なら俺に聞け! Part 132 - 暇つぶし2ch398:デフォルトの名無しさん
07/10/26 17:12:01
>>397
§6.7.3.6
An object that has volatile-qualified type may be modified in ways unknown to the
implementation or have other unknown side effects. Therefore any expression referring
to such an object shall be evaluated strictly according to the rules of the abstract machine,
as described in 5.1.2.3. Furthermore, at every sequence point the value last stored in the
object shall agree with that prescribed by the abstract machine, except as modified by
theunknown factors mentioned previously.114) What constitutes an access to an object that
has volatile-qualified type is implementation-defined.

確かに実装依存と書いてあるね。しかしアトミックである事を保証できないのならvolatile修飾子の意味は
無い事になってしまう。規格には保証されてなくても実際volatileをそのような目的に使うなら、CPU固有の
振る舞いを知っておく事は非常に重要なはずだ。


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