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.0p0 Hot Tips | CONFIDENTIAL | CodeSecure Inc |
代入演算子が部分式で使われています。その結果、式が:
このワーニングクラスは、以下の場合には発生しません。
| クラス名 | Assignment Result in Expression | ||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 日本語クラス名 | 代入式の副作用 | ||||||||||||||||||||||||||||||
| クラス分類 | スタイル (style) | ||||||||||||||||||||||||||||||
| ニーモニック | LANG.STRUCT.USEASSIGN | ||||||||||||||||||||||||||||||
| カテゴリー |
|
||||||||||||||||||||||||||||||
| 対応言語 | C および C++ で利用可能です。 |
||||||||||||||||||||||||||||||
| 有効/無効設定 | このワーニングクラスのチェックはデフォルトで無効になっており、プロジェクトには非正規の C向けAST
が必要になります。有効にするにはプロジェクト設定ファイル (configuration file) に以下の WARNING_FILTER ルールと
RETAIN_UNNORMALIZED_C_AST 設定を追加してください。
RETAIN_UNNORMALIZED_C_AST = Yes WARNING_FILTER += allow class="Assignment Result in Expression" |
int g;
int f(int i);
int lang_struct_useassign(int *a){
int x;
int y;
int vla[g=32]; /* 'Assignment Result in Expression' warning issued here */
y = x = 1; /* 'Assignment Result in Expression' warning issued here */
f(x+=3); /* 'Assignment Result in Expression' warning issued here */
if (x=3){ /* 'Assignment Result in Expression' warning issued here
* ('Redundant Condition' also issued)
*/
x = y++; /* postincrement result */
}
if ((x==x) || (x=3)){ /* 'Assignment Result in Expression' warning issued here
* (even though subexpression will never be executed:
* 'Unreachable Conditional' and 'Redundant Condition' warnings also issued)
*/
x = ++x; /* 'Assignment Result in Expression' warning issued here */
}
x += (y += x, y); /* comma operand */
return x;
}
設定ファイルの以下のパラメータがこのワーニングクラスのチェックに影響します。