规则2.3:一个项目不包含未使用的Typedef声明

发布于 2025-01-21 23:22:55 字数 221 浏览 2 评论 0原文

规则2.3:一个项目不包含未使用的Typedef声明:如果声明但未使用类型,那么对于审阅者而言,如果类型是多余的,则尚不清楚它是错误的。 “ 通过AutoSar在MATLAB SIMULINK中生成代码后,我使用Misra规则检查和Polyspace代码供供供您检查生成的代码。 Misra是否可以从列表中删除RTE .H文件并检查其余库和代码? (我不想检查rte.h文件。但是如何?)

"Rule 2.3: A project shall not contains unused typedef declarations: If a type is declared but not used, then it is unclear to a reviewer if the type is redundant or it has been left unused by mistake."
After generating code in matlab simulink via AUTOSAR, I use Misra rule check and Polyspace code prover to check the generated code. Is there a way for Misra to remove the RTE .h file from its list and check the rest of the libraries and code? (I do not want to MISRA check the RTE.h file. but how ??)

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

泛泛之交 2025-01-28 23:22:55

这通常是特定于工具的活动...

根据工具,您可以指定该文件未检查,或在文件中包含适当的注释以关闭特定的指南检查。

另外,按照规则2.3是咨询,根据Misra合规性,您可以不赞成单个文件或更一般的文件。同样,这将在您的工具中实现。

我可以在一个特定工具上提供指导(请参阅个人资料),但是如果手册没有帮助,最好与供应商交谈。


顺便说一句:

  1. MISRA将于自动生成代码发布指南重新分类计划 - 这建议用户 livs 规则2.3 for auto -code。
  2. 如果您想要求Misra合规性,则分析需要包括所有文件(包括您的rte.h),尽管允许使用采用的代码(包括自动生成代码) )。

请参阅隶属关系的配置文件。

This is typically a tool-specific activity...

Depending on the tool, you can specify that file to be not checked, or include appropriate annotations in the file to switch off specific guideline checks.

Also, as Rule 2.3 is Advisory, in accordance with MISRA Compliance, you can Disapply it (with justification) either for a single file or more generally. Again, that would be implemented within your tool.

I can give guidance on one particular tool (see profile), but you're better talking with your vendor, if the manual is not helpful.


As an aside:

  1. MISRA is due to release a Guideline Reclassification Plan for automatically generated code - this proposes that users Disapply Rule 2.3 for auto-code.
  2. If you want to claim MISRA Compliance, the analysis needs to include all files (including your RTE.H) although some relaxation is permitted for adopted code (including auto-generated code).

See profile for affiliation.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文