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 |
オブジェクトV に式E の値が代入されたとき、
例外 1: このクラスのワーニングは初期化子 {0} を使用している場合は検出されません。
例外 2: このクラスのワーニングは、 式の値が符号なし整数型で表現可能で、符号付き整数型の整数定数式から 符号なし整数型 への代入の場合は検出されません。
Exception 3: a warning of this class will not be issued for an assignment of an expression of essentially real floating type to a location of essentially complex floating type, provided that the corresponding real type of the location is not narrower than the type of the expression.
このワーニングクラスは、クリティカルシステム向けのC言語ガイドラインMISRA C:2012の実質的な型に記載されている概念に基づいています。
| クラス名 | Inappropriate Assignment Type | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 日本語クラス名 | 不適切な型への代入 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| クラス分類 | スタイル (style) | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| ニーモニック | LANG.TYPE.IAT | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| カテゴリー |
|
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 対応言語 | C および C++ で利用可能です。 |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 有効/無効設定 | このワーニングクラスのチェックはデフォルトで無効になっており、プロジェクトには非正規の C向けAST
が必要になります。有効にするにはプロジェクト設定ファイル (configuration file) に以下の WARNING_FILTER ルールと
RETAIN_UNNORMALIZED_C_AST 設定を追加してください。
RETAIN_UNNORMALIZED_C_AST = Yes WARNING_FILTER += allow class="Inappropriate Assignment Type" |
void use_values(short int s, float fl, unsigned int u);
void TYPE_IAT(long long int lli, int i){
short int si = lli; /* 'Inappropriate Assignment Type' warning issued here */
float f = i; /* 'Inappropriate Assignment Type' warning issued here */
struct {double x; double y;} pt = {0}; /* {0} initializer */
unsigned int x = 4; /* signed constant 4 fits in an unsigned int */
use_values(si, f, x);
}
設定ファイルの以下のパラメータがこのワーニングクラスのチェックに影響します。