MISRA Discussion Forums

Full Version: Was something missed for 12.6 about "?:"?
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
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.
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.