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 |
式の括弧が不十分なので、Misra2012:12.1、Misra2004:12.1、及び MisraC++2008:5-0-2 の明示的な演算子の 優先順位の要求に合っていません。特に、:
このワーニングクラスの適用上、演算子の優先順位は、Misra2012:12.1に従います:
説明 演算子 または オペランド 優先順位 最優先 識別子、定数、文字列リテラル、( 式 ) 16 (高) 後置演算子 [] () (関数呼び出し) . -> ++ (後置インクリメント) -- (後置デクリメント) () {} (C99: コンパウンドリテラル) 15 単項演算子 ++ (前置インクリメント) -- (前置デクリメント) & * + - ~ ! sizeof defined (プリプロセッサ) 14 キャスト演算子 () 13 乗算、除算、剰余 * / % 12 加算、減算 + - 11 シフト演算子 << >> 10 関係演算子 < > <= >= 9 等価演算子 == != 8 ビットAND & 7 ビットXOR ^ 6 ビットOR | 5 論理AND && 4 論理OR || 3 条件演算子 ?: 2 代入演算子 = *= /= %= += -= <<= >>= &= ^= |= 1 コンマ演算子 , 0 (低)
| クラス名 | Missing Parentheses | |||||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 日本語クラス名 | 不十分な括弧 | |||||||||||||||||||||||||||||||||||||||
| クラス分類 | スタイル (style) | |||||||||||||||||||||||||||||||||||||||
| ニーモニック | LANG.STRUCT.PARENS | |||||||||||||||||||||||||||||||||||||||
| カテゴリー |
|
|||||||||||||||||||||||||||||||||||||||
| 対応言語 | C および C++ で利用可能です。 |
|||||||||||||||||||||||||||||||||||||||
| 有効/無効設定 | このワーニングクラスのチェックはデフォルトで無効になっており、プロジェクトには非正規の C向けAST
が必要になります。有効にするにはプロジェクト設定ファイル (configuration file) に以下の WARNING_FILTER ルールと
RETAIN_UNNORMALIZED_C_AST 設定を追加してください。
RETAIN_UNNORMALIZED_C_AST = Yes WARNING_FILTER += allow class="Missing Parentheses" |
#include <stddef.h>
int lang_struct_parens(void){
int x=1;
size_t s,t;
s = sizeof x; /* 'Missing Parentheses' warning issued here */
t = sizeof(x); /* sizeof argument parenthesized */
x = x << t + s; /* 'Missing Parentheses' warning issued here */
x += x << (t + s); /* sub-expression parenthesized */
return x;
}
設定ファイルの以下のパラメータがこのワーニングクラスのチェックに影響します。
To report problems with this documentation, please visit https://support.codesecure.com/.