Was something missed for 12.6 about "?:"?

6.12 Expressions

Moderators: misra-c, david ward

Post Reply
Posts: 87
Joined: Thu Nov 18, 2004 1:39 am

Was something missed for 12.6 about "?:"?

Post by gs » Thu May 06, 2010 4:25 pm

The wording of advisory #12.6 indicates expressions other than effectively boolean ones are permitted as the conditional argument to "?:". Was this wording an oversight? In three other circumstances, the guidelines insist on effectively boolean expressions and it seems unintuitive to not require such in this case as well.

Posts: 572
Joined: Thu Jan 05, 2006 1:11 pm

Re: Was something missed for 12.6 about "?:"?

Post by misra-c » Thu May 13, 2010 10:43 am

It is intended that the first operand of the ternary operator should be effectively Boolean. This will be made clear in a future revision of the MISRA C Guidelines.
Posted by and on behalf of
the MISRA C Working Group

Post Reply

Return to “6.12 Expressions”