JavaScript is not currently enabled, but is required for full CodeSonar manual search and browse functionality.
If you are viewing this file in your hub's Web GUI, enable JavaScript in your browser: you will also need it for GUI functionality.
If you opened this file directly from disk, your browser may be directly suppressing JavaScript functionality: certain browsers perform this suppression on local files (but not files delivered by web servers) for security reasons.
| CodeSonar® 9.2p0 | CONFIDENTIAL | CodeSecure Inc |
エントリポイント関数から到達不能なコードが存在しています。
以下は到達不能コードのワーニングクラスの一覧で、重要度の高い順に並んでいます。 到達不能コードの検出は、該当する最も重要なクラスが適用されます。
| ワーニングクラス名 | 到達不能における最も深刻な状況の分類 |
|---|---|
| 到達不能な関数呼び出し | 関数呼び出しに到達しない |
| 到達不能な計算 | (加算命令の様な)計算命令に到達しない |
| 到達不能な条件 | if, while, switch, ?, &&, || などの分岐に到達しない |
| 到達不能なデータフロー | 単純な代入文や値を返す return 文に到達しない |
| 到達不能なコントロールフロー | break, goto, continue, 値を返さない return 文などのコントロールフローに到達しない |
複数のワーニングクラスでこのニーモニックを共有しています。
これらを全て有効もしくは無効にするには、プ ロジェクト設定ファイル(configuration file)に以下の WARNING_FILTER ルールを追加し てください。
WARNING_FILTER += allow categories:LANG.STRUCT.UC WARNING_FILTER += discard categories:LANG.STRUCT.UC
| クラス名 | Unreachable Call | ||||||||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 日本語クラス名 | 到達不能な関数呼び出し | ||||||||||||||||||||||||||||||||||||||||||
| クラス分類 | 冗長性 (redundancy) | ||||||||||||||||||||||||||||||||||||||||||
| ニーモニック | LANG.STRUCT.UC | ||||||||||||||||||||||||||||||||||||||||||
| カテゴリー |
|
||||||||||||||||||||||||||||||||||||||||||
| 対応言語 | C および C++ で利用可能です。 |
||||||||||||||||||||||||||||||||||||||||||
| 有効/無効設定 | このワーニングクラスのチェックはデフォルトで有効になっています。チェックを無効にするにはプロジェクト設定ファイル
(configuration file)に以下の WARNING_FILTER ルールを追加してください。
WARNING_FILTER += discard class="Unreachable Call" |
| クラス名 | Unreachable Computation | |||||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 日本語クラス名 | 到達不能な計算 | |||||||||||||||||||||||||||||||||||||||
| クラス分類 | 冗長性 (redundancy) | |||||||||||||||||||||||||||||||||||||||
| ニーモニック | LANG.STRUCT.UC | |||||||||||||||||||||||||||||||||||||||
| カテゴリー |
|
|||||||||||||||||||||||||||||||||||||||
| 対応言語 | C および C++ で利用可能です。 |
|||||||||||||||||||||||||||||||||||||||
| 有効/無効設定 | このワーニングクラスのチェックはデフォルトで有効になっています。チェックを無効にするにはプロジェクト設定ファイル
(configuration file)に以下の WARNING_FILTER ルールを追加してください。
WARNING_FILTER += discard class="Unreachable Computation" |
| クラス名 | Unreachable Conditional | |||||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 日本語クラス名 | 到達不能な条件 | |||||||||||||||||||||||||||||||||||||||
| クラス分類 | 冗長性 (redundancy) | |||||||||||||||||||||||||||||||||||||||
| ニーモニック | LANG.STRUCT.UC | |||||||||||||||||||||||||||||||||||||||
| カテゴリー |
|
|||||||||||||||||||||||||||||||||||||||
| 対応言語 | C および C++ で利用可能です。 |
|||||||||||||||||||||||||||||||||||||||
| 有効/無効設定 | このワーニングクラスのチェックはデフォルトで有効になっています。チェックを無効にするにはプロジェクト設定ファイル
(configuration file)に以下の WARNING_FILTER ルールを追加してください。
WARNING_FILTER += discard class="Unreachable Conditional" |
| クラス名 | Unreachable Control Flow | |||||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 日本語クラス名 | 到達不能なコントロールフロー | |||||||||||||||||||||||||||||||||||||||
| クラス分類 | 冗長性 (redundancy) | |||||||||||||||||||||||||||||||||||||||
| ニーモニック | LANG.STRUCT.UC | |||||||||||||||||||||||||||||||||||||||
| カテゴリー |
|
|||||||||||||||||||||||||||||||||||||||
| 対応言語 | C および C++ で利用可能です。 |
|||||||||||||||||||||||||||||||||||||||
| 有効/無効設定 | このワーニングクラスのチェックはデフォルトで無効になっています。チェックを有効にするにはプロジェクト設定ファイル
(configuration file)に以下の WARNING_FILTER ルールを追加してください。
WARNING_FILTER += allow class="Unreachable Control Flow" |
| クラス名 | Unreachable Data Flow | |||||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 日本語クラス名 | 到達不能なデータフロー | |||||||||||||||||||||||||||||||||||||||
| クラス分類 | 冗長性 (redundancy) | |||||||||||||||||||||||||||||||||||||||
| ニーモニック | LANG.STRUCT.UC | |||||||||||||||||||||||||||||||||||||||
| カテゴリー |
|
|||||||||||||||||||||||||||||||||||||||
| 対応言語 | C および C++ で利用可能です。 |
|||||||||||||||||||||||||||||||||||||||
| 有効/無効設定 | このワーニングクラスのチェックはデフォルトで有効になっています。チェックを無効にするにはプロジェクト設定ファイル
(configuration file)に以下の WARNING_FILTER ルールを追加してください。
WARNING_FILTER += discard class="Unreachable Data Flow" |
#include <stdlib.h>
#include <stddef.h>
void g(void);
int f(int i){
if( i ) exit( i );
return 0;
}
/* For unreachable_computation(), unreachable_conditional(),
* unreachable_conditional(), and unreachable_data_flow(), the first
* statement in the function body is
* int rv = f(5);
*
* The call to f() is reachable but never returns, so the remainder of
* the function, including the assignment of the return value to rv
* that takes place in the same statement, is unreachable. (This
* assignment is itself a data flow.) The warning class for each of
* these cases will depend on the nature of the statements in the
* unreachable block.
*/
int unreachable_call(int x){
int p;
int rv = f(5); /* 'Unreachable Call' warning issued here */
g(); /* call (highest severity) */
rv += x; /* computation */
if (x>5) { /* conditional */
return 0; /* data flow */
}
p = rv; /* data flow */
return p;
}
int unreachable_computation(int x){
int p;
int rv = f(5); /* 'Unreachable Computation' warning issued here */
rv += x; /* computation (highest severity) */
if (x>5) { /* conditional */
return 0; /* data flow */
}
p = rv; /* data flow */
return p;
}
int unreachable_conditional(int x){
int p;
int rv = f(5); /* 'Unreachable Conditional' warning issued here */
if (x>5) { /* conditional (highest severity) */
return 0; /* data flow */
}
p = rv; /* data flow */
return p;
}
int unreachable_data_flow(void){
int p;
int rv = f(5); /* 'Unreachable Data Flow' warning issued here */
p = rv; /* data flow */
return p;
}
/* In unreachable_control_flow(), a return statement is unreachable
* because it is in the TRUE branch of an IF statement whose condition
* always evaluates to FALSE.
*/
void unreachable_control_flow(int x, int y){
char *q = NULL;
while (q==NULL){
q = (char *) malloc(5 * sizeof(char));
}
if (q==NULL) { /* ('Redundant Condition' warning issued here) */
return; /* 'Unreachable Control Flow' warning issued here */
}
free(q);
}
設定ファイルの以下のパラメータがこのワーニングクラスのチェックに影響します。
To report problems with this documentation, please visit https://support.codesecure.com/.