20-06-2006, 02:02 PM
Good point!
It was not intended that the use of 1 bit bitfields to store TRUE/FALSE should be banned.
Rules 10.1 and 10.3 were designed with signed and unsigned expressions in mind. The treatment of enums, bitfields, chars, relational operators ( < , , >= ), logical operators ( &&, || ) and equality operators ( ==, != ) do not fit this model as yet.
Clarifications are under consideration to address this.
Paragraph 4 and paragraph 5 above are withdrawn.
Provisional position:
The underlying type of the result of a logical operator is considered to be 1-bit, i.e. Boolean.
It was not intended that the use of 1 bit bitfields to store TRUE/FALSE should be banned.
Rules 10.1 and 10.3 were designed with signed and unsigned expressions in mind. The treatment of enums, bitfields, chars, relational operators ( < , , >= ), logical operators ( &&, || ) and equality operators ( ==, != ) do not fit this model as yet.
Clarifications are under consideration to address this.
Paragraph 4 and paragraph 5 above are withdrawn.
Provisional position:
The underlying type of the result of a logical operator is considered to be 1-bit, i.e. Boolean.
Posted by and on behalf of the MISRA C Working Group