0

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.

Clifford
  • 88,407
  • 13
  • 85
  • 165
  • It is often the case that a rule can be complied with where the developer simply lacks the knowledge, experience, skill or perhaps imagination to know how. That being the case you might instead of suppressing a rule, post the code, explain what rule it breaks and ask for a compliant solution. That may not be the case here, but it is often worth posting the code and the rule to SO asking for a solution or whether suppression is even safe in context. – Clifford Jan 13 '19 at 17:48
  • Thank you for your valuable suggestions , I just want to know is there a possibility to do. It is not always possible to be in compliance with the QAC standard in some snippet of the code we may have to deviate from the standard if we have reason. – Vasanthakumar Feb 14 '19 at 22:49

3 Answers3

4

You can add a comment above the line where there is a warning e.g.

/* PRQA S 0434*/ 
Rishikesh Raje
  • 8,556
  • 2
  • 16
  • 31
0

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.

Clifford
  • 88,407
  • 13
  • 85
  • 165
0

"Diagnostic Suppression/Suppression Syntax" is where to look in the MCPP component help.