Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Rule 12.6 and functions taking/returning Boolean values.
#3
misra-c Wrote:The function call operator should have been included in this list with the caveat that expressions with effectively Boolean type may be used in the argument list where the corresponding parameter also has effectively Boolean type.

OK, so the first example is compliant with respect to the proper meaning of Rule 12.6.

misra-c Wrote:An expression with effectively Boolean type may also be used in a return statement and also to initialise an object but Rule 12.6 does not apply to these cases because there are no operators present.

If Rule 12.6 does not apply to return statements (and object inizializations), then which rule is violated by the code in the second example above?
As far as we can tell, the overall guideline is that effectively Boolean types/expressions should not be confused with the proper arithmetic types/expressions, i.e., they need to be clearly separated as is the case for "plain char" types/expressions. However, we seem to be missing a specific rule corresponding to Rule 6.1.
<t></t>
Reply


Messages In This Thread

Forum Jump:


Users browsing this thread: 3 Guest(s)