20-02-2014, 08:42 AM
There is nothing in the MISRA-C:2004 rules that prevents your project defining an "effectively boolean type" as a double. However, the MISRA group would strongly recommend that you did not do this.
You are correct in saying that !3.7 will deliver an integer value of 0. However, for the purposes of some of the MISRA rules, the "!" is considered to return the MISRA "effectively boolean type".
You are correct in saying that !3.7 will deliver an integer value of 0. However, for the purposes of some of the MISRA rules, the "!" is considered to return the MISRA "effectively boolean type".
Posted by and on behalf of the MISRA C Working Group