Other Parts Discussed in Thread: CODECOMPOSER
Tool/software: TI C/C++ Compiler
Hello everybody,
I am just interested in static code analysis based on Misra C guidelines and i have the following warning generated cases which i can't understand.
warning 1:
I have misra warning says:
" If the bitwise operators ~ and << are applied to an operand of underlying type unsigned char or unsigned short,
the result shall be immediately cast to the underlying type of the operand"
in the following statement:
CAN0_CTL_R &= ~ CAN_CTL_INIT;
where:
#define CAN_CTL_INIT 0x00000001U // Initialization #define CAN0_CTL_R (*((volatile uint32_t *)0x40040000U))
----------------------------------------------------------------------------------------------------
warning 2:
does any of these may be a bug in the misra tool ?
Regards,
Sarea