MISRA C:2012 Dir 4.6
typedefs
that indicate size and signedness should be used in place of the basic numerical types
描述
指令定义
typedefs
that indicate size and signedness should be used in place of the basic numerical types.
理由
当分配的内存量很重要时,通过使用特定长度的类型可以明确为每个对象保留多少存储空间。
Polyspace 实现
此规则检查项会在变量或函数声明和定义中标记基本数据类型的使用。此规则会强制应用 typedef
。
此规则检查项不会在 typedef
语句自身中标记基本类型的使用。
故障排除
如果您预计存在违规,但未看到该违规,请参阅Diagnose Why Coding Standard Violations Do Not Appear as Expected。
示例
检查信息
组:代码设计 |
类别:建议 |
AGC 类别:建议 |