MISRA C Rule­6.1 0635 Rule­7.2 1281

 时间:2024-10-12 20:52:47

、struct/union中的位域被声明为除int、signed int或unsigned int外的其他类型 ; 整型常量是无符号类型,但没有使用后缀符'U' 。

工具/原料

Rule­6.1 0635 Rule­7.2 1281

MISRA C:2012

Rule­6.1 0635

1、规则与等级对应关系(QAC)

MISRA C Rule­6.1 0635 Rule­7.2 1281

2、 罕铞泱殳 0635 [E] Bit-fields in this struct/u荏鱿胫协nion have been declared with types other than int, signed int or unsigned int.struct/union中的位域被声明为除int、signed int或unsigned int外的其他类型

3、根据ISO:C 标准,位域只能定义为以下类型:int/unsigned int/signed int。有些编译器髹瑕扔麝支持一些其他整型,比如char,short和enum。这属于语言的扩展,且是不可移植的。在struct或union声明中,无论含有多少非标准位域,消息0635只会生成一次。

MISRA C Rule­6.1 0635 Rule­7.2 1281

4、编程规范修改举例

MISRA C Rule­6.1 0635 Rule­7.2 1281

Rule­7.2 1281

1、规则与等级对应关系(QAC)

MISRA C Rule­6.1 0635 Rule­7.2 1281

2、 罕铞泱殳 1281 Integer literal constant is of 锾攒揉敫an unsigned type but does not include a "U" suffix. 这是整型常量是无符号类型,但没有使用后缀符 'U' 。注意:一个整数常量的类型,依赖于常量的值大小、'int'型被实现的大小(即是说 'int' 型是16位还是32位)以及出现的后缀符。

3、官方示例

MISRA C Rule­6.1 0635 Rule­7.2 1281

4、编程规范修改举例

MISRA C Rule­6.1 0635 Rule­7.2 1281
  • 如何快速找到萝卜快跑软件上意见反馈的入口?
  • LOL手游涂鸦怎么获取
  • 怎样让孩子早点上床睡觉
  • 这些花卉不要再在室内养了,放时间长了会损害你的健康!
  • 疯狂猜成语3 开卷有益第111关攻略答案
  • 热门搜索
    清明旅游推荐 湖北自驾旅游 山西晋城旅游 互助旅游 云南旅游信息 呼伦贝尔草原旅游 坝美最佳旅游时间 香港迪士尼旅游 秋季旅游好去处 西安旅游租车