MISRA C:2012 Rule 2.3
A project should not contain unused type declarations
描述
默认 Polyspace® as You Code 分析中反激活了此检查项。请参阅Checkers Deactivated in Polyspace as You Code Analysis (Polyspace Access)。
规则定义
A project should not contain unused type declarations 1 .
理由
如果声明了一个类型但未使用,则评审不知道该类型是冗余的还是错误地未使用。
Polyspace 实现
如果您的代码中仍未使用 Polyspace,则 typedef
会报告违反此规则。
故障排除
如果您预计存在违规,但未看到该违规,请参阅Diagnose Why Coding Standard Violations Do Not Appear as Expected。
示例
检查信息
组:未使用的代码 |
类别:建议 |
AGC 类别:可读性 |
版本历史记录
在 R2014b 中推出1 All MISRA coding rules and directives are © Copyright The MISRA Consortium Limited 2021.
The MISRA coding standards referenced in the Polyspace Bug Finder™ documentation are from the following MISRA standards:
MISRA C:2004
MISRA C:2012
MISRA C:2023
MISRA C++:2008
MISRA C++:2023
MISRA and MISRA C are registered trademarks of The MISRA Consortium Limited 2021.