-termination-functions
プロセス終了関数を指定します。
構文
-termination-functions function1[,function2[,...]]
説明
-termination-functions は、関数 exit と同様に動作しプログラムを終了する関数を指定します。function1[,function2[,...]]
このオプションは、宣言されているがコード内に定義されていないプログラム終了関数を指定するために使用します。
ユーザー インターフェイス (Polyspace® デスクトップ製品のみ) では、[構成] ペインの [その他] フィールドにこのオプションを入力します。Otherを参照してください。
例
Polyspace は my_exit がプログラムを終了するのを認識しないため、次のコードで [整数のゼロ除算] 欠陥を検出します。
void my_exit(void);
void main() {
double ans;
ans = reciprocal(1);
ans = reciprocal(0);
}
double reciprocal(int val) {
if(val==0)
my_exit();
return (1/val);
}-termination-functions オプションを使用します。polyspace-bug-finder -termination-functions my_exit