Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Underlying Type Presumptions
#4
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.
Posted by and on behalf of the MISRA C Working Group


Messages In This Thread

Forum Jump:


Users browsing this thread: 1 Guest(s)