网站首页 美食营养 游戏数码 手工爱好 生活家居 健康养生 运动户外 职场理财 情感交际 母婴教育 生活知识 知识问答

MISRA C Rule­10.1 4501 4511 4521

时间:2025-01-05 17:52:18

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

工具/原料

Rule­10.1 4501 4511 4521

MISRA C:2012

Rule­10.1 4501

1、 4501 An expression of 'essentially Boolean' type (%1s) is being used as the %2s operand of this arithmetic operator (%3s). 当基本布尔类型的表达式被用作算术运算符的操作数时,会产生此消息。

2、官方示例

MISRA C Rule­10.1 4501 4511 4521

3、编程规范修改举例

MISRA C Rule­10.1 4501 4511 4521

Rule­10.1 4511

1、4511 An expression of 'essentially character' type (%1s) is being used as the %2s operand of this arithmetic operator (%3s). 当基本字符类型的表达式被用作算术运算符的操作数时,会产生此消息。 需注意如果是二进制操作符+或-时则不会产生此消息。

2、官方示例

MISRA C Rule­10.1 4501 4511 4521

3、编程规范修改举例

MISRA C Rule­10.1 4501 4511 4521

Rule­10.1 4521

1、 4521 An expression of 'essentially enum' type (%1s) is being used as the %2s operand of this arithmetic operator (%3s). 当基本枚举类型的表达式被用作算术运算符的操作数时,会产生此消息。

2、官方示例

MISRA C Rule­10.1 4501 4511 4521

3、编程规范修改举例

MISRA C Rule­10.1 4501 4511 4521
© 2026 一点知道
信息来自网络 所有数据仅供参考
有疑问请联系站长 site.kefu@gmail.com