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 |
void ポインタと整数型の間でキャストされています。
例外:定数 0 から void ポインタへのキャストはこのクラスのワーニングを引き起こしません。
| クラス名 | Cast: Arithmetic Type/Void Pointer | |||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 日本語クラス名 | 算術型とvoidポインタ間のキャスト | |||||||||||||||||||||||||||
| クラス分類 | スタイル (style) | |||||||||||||||||||||||||||
| ニーモニック | LANG.CAST.PC.AV | |||||||||||||||||||||||||||
| カテゴリー |
|
|||||||||||||||||||||||||||
| 対応言語 | C および C++ で利用可能です。 |
|||||||||||||||||||||||||||
| 有効/無効設定 | このワーニングクラスのチェックはデフォルトで無効になっており、プロジェクトには非正規の C向けAST
が必要になります。有効にするにはプロジェクト設定ファイル (configuration file) に以下の WARNING_FILTER ルールと
RETAIN_UNNORMALIZED_C_AST 設定を追加してください。
RETAIN_UNNORMALIZED_C_AST = Yes WARNING_FILTER += allow class="Cast: Arithmetic Type/Void Pointer" |
void use_pointers(void* p1, void *p2, void *p3);
void use_ints(int x, int y);
void PC_AtoV(int i){
void *pv = (void *) i; /* 'Cast: Arithmetic Type/Void Pointer' warning issued here */
void *cpv = i; /* not a cast ('Bad Initializer Type' warning issued) */
void *pnull = (void *) 0; /* specific exception */
use_pointers(pv, cpv, pnull);
}
void PC_VtoA(void *pv){
int i = (int) pv; /* 'Cast: Arithmetic Type/Void Pointer' warning issued here */
int ci = pv; /* not a cast ('Bad Initializer Type' warning issued) */
use_ints(i, ci);
}
設定ファイルの以下のパラメータがこのワーニングクラスのチェックに影響します。
To report problems with this documentation, please visit https://support.codesecure.com/.