18. 3.4.3 undefined behavior: behavior, upon use of a non
portable or erroneous program construct or of erroneous
data, for which this International Standard imposes no
requirements
NOTE Possible undefined behavior ranges from ignoring the situation completely with
unpredictable results, to behaving during translation or program execution in a
documented manner characteristic of the environment (with or without the issuance of a
diagnostic message), to terminating a translation or execution (with the issuance of a
diagnostic message).
EXAMPLE An example of undefined behavior is the behavior on integer overflow.
3.4.4 unspecified behavior: use of an unspecified value,
or other behavior where this International Standard
provides two or more possibilities and imposes no
further requirements on which is chosen in any Instance
EXAMPLE An example of unspecified behavior is the order in which the arguments to a
function are evaluated.
2013/7/7
(c)kaizen@wh.commufa.jp,
@kaizen_nagoya
18
19. 工程FMEAと部品FMEAに分類
規則:Dir4.2 All usage of assembly language
should be documented
工程:文書化していないアセンブラコードがある
影響:振る舞いの異なるCPUで動作がわからない
Dir4.7 R If a function returns error
information, then that error information shall be
tested
製品:エラー情報を試験していない
影響:エラー情報に基づいた処理になっていない可
能性があり動作が保証できない
20. Dir4.9 A function should be used in
preference to a function-like macro where
they are interchangeable
工程:函数と思って使う間違う
影響:設計者の意図と異なる値を返す
対策:函数に書き換えて比較評価する
部品:ホワイトボックステストを書きに
くい
影響:
対策:函数に書き換えて比較評価する
23. The validity of values passed to library functions
shall be checked
no 値がない
reverse
引数の並びが逆
引数の値が逆(0と1)
引数の値が上位と下位が逆(big endian
とlittle endian)
othher
than
引数の順番がずれている
引数の型が違う
割り算で使う値に0が入っている
more
上限値より大きい
16bitの値に32bitの値を渡そうとしてい
る
下限値より小さい