Note that there are some explanatory texts on larger screens.

plurals
  1. POTelling VX-Tasking that "bool" in a boolean?
    primarykey
    data
    text
    <p>I'm using the Tasking VX toolset (built on Eclipse) and have a fairly basic but fundamental problem that I can't get around... I've RTFMed and am still totally none the wiser.</p> <p>Imagine the simple snippet of code:</p> <pre><code>#include &lt;stdbool.h&gt; bool myFlag = false; </code></pre> <p>If I enable MISRA-C checking, I get the following:</p> <pre><code>MISRA-C rule 10.1 violation: [R] restrict the use of implicit conversions for integer types </code></pre> <p>Eclipse is set up as a C99 implementation, and as per the <a href="http://pubs.opengroup.org/onlinepubs/9699919799/basedefs/stdbool.h.html" rel="nofollow">standard library definition</a>, <code>stdbool.h</code> is defined as:</p> <pre><code>#define bool _Bool #define true 1 #define false 0 </code></pre> <p>I'm assuming that this error is because <code>#define false 0</code> and the tool is implicitly converting to bool?</p> <p>Note: if I cast the assignment, then the error is removed:</p> <pre><code> bool myFlag = (bool)false; </code></pre> <p>But (IMHO) that is masking the problem, not addressing it, and I really do not want to cast every assignment.</p> <p>Tools such as LINT allow you to specify the bool type to stop these sort of false positives... I need the equivalent for Eclipse/Tasking</p> <hr> <p>So my question is this:</p> <p><strong>I suspect that somewhere there is a tool option to tell TASKING that <code>bool</code> is the boolean type, and therefore <code>false</code> and <code>true</code> are OK to be used?</strong></p> <p>Is there?</p> <p>{Please no discussions [on this thread] about the merits (or otherwise) of MISRA}</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload