MISRA 5-2-1 规则需要后缀表达式?

MISRA 5-2-1 rule requires postfix-expressions?

MISRA-2008 中的规则 5-2-1 指出

Each operand of a logical && or || shall be a postfix-expression. Exception: Where an expression consists of either a sequence of only logical && or a sequence of only logical ||, extra parentheses are not required.

下面是文档本身的示例:

if (x == 0 && ishigh)      // Non-compliant
if (( x == 0 ) && ishigh)  // Compliant
if (x || y || z)           // Compliant by exception, if x, y and z bool
if (x || y && z)           // Non-compliant
if (x || (y && z))         // Compliant
if (x && !y)               // Non-compliant
if (x && (!y))             // Compliant
if (is_odd(y) && x)        // Compliant
if ((x > c1) && (y > c2)  && (z > c3))   // Compliant - exception
if ((x > c1) && (y > c2)  || (z > c3))   // Non-compliant
if ((x > c1) && ((y > c2) || (z > c3)))  // Compliant as extra() used

有人能指出 posfix 表达式在哪里吗?它们看起来是主要的。我没有看到 ++--.

之类的内容

所有主表达式都是后缀表达式。在这些示例中,唯一不是主表达式的后缀表达式是 is_odd(y).

后缀表达式的 grammar 是:

postfix-expression:

primary-expression
postfix-expression [ expr-or-braced-init-list ]
postfix-expression ( expression-listopt )
simple-type-specifier ( expression-listopt )
typename-specifier ( expression-listopt )
simple-type-specifier braced-init-list
typename-specifier braced-init-list
postfix-expression . templateopt id-expression
postfix-expression -> templateopt id-expression
postfix-expression ++
postfix-expression --
dynamic_­cast < type-id > ( expression )
static_­cast < type-id > ( expression )
reinterpret_­cast < type-id > ( expression )
const_­cast < type-id > ( expression )
typeid ( expression )
typeid ( type-id )

primary-expression:

literal
this
( expression )
id-expression
lambda-expression
fold-expression
requires-expression