简体   繁体   中英

Is it possible to suppress MISRA warning in QA-C

I used:

#pragma QAC MESSAGE OFF. RULE NUMBER

It works for many of the messages to suppress the QAC warnings but this technique is not working for Message No 434. Do we have any other methods to suppress these QAC warnings.

您可以在有警告的行上方添加注释,例如

/* PRQA S 0434*/ 

I believe that it is not possible to suppress MISRA rules using in-code #pragma or comment suppression in QA-C as explained here . I imagine this is explained in the documentation (which I do not have access to at present). The reasoning is that it would diminish the trust in the MISRA report if a developer could arbitrarily suppress it for specific code - hiding the deviation from your client or enforcement authority.

If MISRA compliance is a contractual or legal requirement in your case, you should document each deviation and let the warning stand. If you are just using MISRA as a "ready made" coding standard, then it may be better to configure the standard QA-C rules to check the MISRA rules without such strong enforcement. I think there are equivalents to most MISRA rules or they can be synthesised from multiple rules.

“诊断抑制/抑制语法”是在 MCPP 组件帮助中查找的位置。

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM