This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

C2000 MISRA-C R12.6

Hi folks,

C2000, v6.2.10 C/C++ compiler with MISRA enabled shows a violation of R12.6 (The operands of logical operators (&&, || and !) should be effectively Boolean.) for the following if condition:

if (s->foo || s->bar) {
    /* ... */
}

Im not 100% sure on the semantics of the rule here but aren't the conditions `s->foo` & `s->bar` Boolean without explicitly adding `!= 0` ?

Ta