13-02-2015, 09:49 AM
Given the cast on the first line, we assume that "tmp" has a "signed short" or "signed int" type. "tmp & 8192" therefore violates rule 12.7.
The result of "((tmp & 8192) != 0)" is effectively Boolean and is used as an operand to "+", which therefore violates rule 12.6.
The MISRA-C Working Group can make no further comment as to how a particular auto-coder can be configured to avoid these violations, but perhaps other users may help you.
The result of "((tmp & 8192) != 0)" is effectively Boolean and is used as an operand to "+", which therefore violates rule 12.6.
The MISRA-C Working Group can make no further comment as to how a particular auto-coder can be configured to avoid these violations, but perhaps other users may help you.
Posted by and on behalf of the MISRA C Working Group