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 |
The default association for a C generic selection expression is selected, but a human reader might expect a different outcome if they (mistakenly) believe that implicit pointer conversion will take place.
The controlling expression of a C generic selection undergoes lvalue conversion, but does not undergo implicit pointer conversion. Once lvalue conversion has taken place, the controlling expression type must exactly match an association type in the association list in order for that association to be selected: otherwise, the default association is selected.
| クラス名 | Implicit Pointer Type Conversion in Selection of C Generic | |||||||||
|---|---|---|---|---|---|---|---|---|---|---|
| 日本語クラス名 | Implicit Pointer Type Conversion in Selection of C Generic | |||||||||
| クラス分類 | スタイル (style) | |||||||||
| ニーモニック | LANG.TYPE.CGEN.IMPTC | |||||||||
| カテゴリー |
|
|||||||||
| 対応言語 | C のみ利用可能です。 C++ は利用できません。 |
|||||||||
| 有効/無効設定 | このワーニングクラスのチェックはデフォルトで無効になっており、プロジェクトには非正規の C向けAST
が必要になります。有効にするにはプロジェクト設定ファイル (configuration file) に以下の WARNING_FILTER ルールと
RETAIN_UNNORMALIZED_C_AST 設定を追加してください。
RETAIN_UNNORMALIZED_C_AST = Yes WARNING_FILTER += allow class="Implicit Pointer Type Conversion in Selection of C Generic" |
#define QUALINT_PTRS(y) (_Generic(y, \
const int*: 0, \
volatile int*: 1, \
default: -1))
#define INT_PTR(y) (_Generic(y, \
int*: 0, \
default: -1))
int lang_type_cgen_imptc(int *pi, void *pv, float *pf){
int rv = 0;
rv += QUALINT_PTRS(pi); /* 'Implicit Pointer Type Conversion in Selection of C Generic' warning issued here
* - selection type int* does not match any non-default association type {const int*, volatile int*},
* but author/reader might have expected otherwise.
*/
rv += INT_PTR(pi); /* ok: selection type int* matches int* association type */
rv += INT_PTR(pv); /* 'Implicit Pointer Type Conversion in Selection of C Generic' warning issued here
* - selection type int* does not match any non-default association type {void*},
* but author/reader might have expected otherwise.
*/
rv += INT_PTR(pf); /* ok: selection type int* does not match non-default association type float*, but
* this is not likely to reflect (or cause) confusion about implicit conversion.
*/
return rv;
}
設定ファイルの以下のパラメータがこのワーニングクラスのチェックに影響します。
To report problems with this documentation, please visit https://support.codesecure.com/.