MISRA C Rule­10.1 4501 4511 4521

 时间:2026-02-17 04:55:46

'基本布尔'类型的表达式被用作该算术运算符的操作数 ;

'基本字符'类型的表达式被用作算术运算符的操作数 ;

'基本枚举'类型的表达式被用作算术运算符的操作数 。

工具/原料

Rule­10.1 4501 4511 4521

MISRA C:2012

Rule­10.1 4501

4501  An expression of 'essentially Boolean' type (%1s) is being used as 

the %2s operand of this arithmetic operator (%3s). 

当基本布尔兼仗类型的表达式被用塑珠作 算术运算符的操作数时,会产生此消息。

官离露侧方示例

MISRA C Rule­10.1 4501 4511 4521

编程规范修改举例

MISRA C Rule­10.1 4501 4511 4521

Rule­10.1 4511

4511  An expression of 'essentially character' type (%1s) is being used as the %2s operand of this arithmetic operator (%3s). 

当基本字符类型的表达式被用作 算术运算符的操作数时,会产生此消息。 需注意如果是二进制操作符+或-时则不会产生此消息。

官方示例

MISRA C Rule­10.1 4501 4511 4521

编程规范修改举例

MISRA C Rule­10.1 4501 4511 4521

Rule­10.1 4521

4521  An expression of 'essentially enum' type (%1s) is being used as the %2s operand of this arithmetic operator (%3s). 

当基本枚举类型的表达式被用作 算术运算符的操作数时,会产生此消息。

官方示例

MISRA C Rule­10.1 4501 4511 4521

编程规范修改举例

MISRA C Rule­10.1 4501 4511 4521

  • MISRA C Rule­8.1 2050 2051
  • MISRA C Rule­8.5 3221 3222
  • MISRA C Rule­8.2 3001 3007
  • MISRA C Rule­8.3 0624 1330
  • MISRA C Rule­6.1 0635 Rule­7.2 1281
  • 热门搜索
    客家酿豆腐的做法 饼的种类及做法大全 熏鲅鱼的做法 下巴长痘痘红肿硬硬的还疼怎么回事 涟漪怎么读 牛腩炖萝卜的做法 姜母鸭的做法 手机丢了怎么办 where怎么读 煤气灶打不着火怎么办