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 |
An object V is assigned the value of an expression E, and
Exception 1: a warning of this class will not be issued for a use of special static initializer {0}.
Exception 2: a warning of this class will not be issued for an assignment of an integer constant expression of essentially signed type to a location of essentially unsigned type if the value of the expression can be represented in the unsigned type.
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.
This warning class utilizes the notion of essential type category as described in MISRA C:2012 Guidelines for the use of the C language in critical systems.
| Class Name | Inappropriate Assignment Type | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Significance | style | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Mnemonic | LANG.TYPE.IAT | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Categories |
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Availability | Available for C and C++. |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Enabling | Checks for this warning class are disabled by default,
and require the unnormalized
C ASTs for the project. To enable them, add the following
WARNING_FILTER rule and RETAIN_UNNORMALIZED_C_AST specification to the project configuration file.
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);
}
The following configuration file parameters affect checks for this warning class.
To report problems with this documentation, please visit https://support.codesecure.com/.