Hello
I would like to find out if the following MISRA warning is being reported correctly, because to me the code doesn't correspond to the warning:
An example of my code is:
typedef enum { enum1, enum2 } enumType;
void function (void) {
enumType Variable1;
Variable1 = enum1;
}
This generates the following MISRA warning:
(MISRA-C:2004 10.1/R) The value of an expression of integer type shall not be implicitly converted to a different underlying type if it is not a conversion to a wider integer type of the same signedness
The --enum_type in my C/C++ Build Propeties is set to "packed". This warning doesn't seem to be reported when the --enum_type is set to "int".
Can anyone tell me if this is a misreported MISRA warning, or if I am mistaken?
Regards
Kieran