Vasanthakumar
Vasanthakumar

Reputation: 3

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.

Upvotes: 0

Views: 11040

Answers (3)

ElvisIsAlive
ElvisIsAlive

Reputation: 33

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

Upvotes: 0

Rishikesh Raje
Rishikesh Raje

Reputation: 8614

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

/* PRQA S 0434*/ 

Upvotes: 5

Clifford
Clifford

Reputation: 93476

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.

Upvotes: 0

Related Questions