Objective

Learn how to apply and manage suppressions of static analysis violations.

Case-specific suppressions provide a systematic way to follow rules in general while making some exceptions that are deemed acceptable by you or your team. Suppressions are essentially filters that block violations from displaying and being reported. Suppression schemes can be stored in the source code, on DTP, on Team Server, or with the local installation(in the workspace).

  1. Run a test and click the Quality Tasks tab.
  2. Fully expand the MISRA C 2004 folder. This expression that violates the rule may cause a bug, but it’s accepted practice for many developers. In such cases, a reported violation can be suppressed.
  3. Right-click the rule description (Assignment operators shall not be used in expressions that yield a Boolean value) and select Suppress Task.


    This removes the violation from the report and creates an entry for it in the suppressions set.
  4. Provide an explanation why the suppression was applied. Enter Not relevant to my code for this exercise.



  5. Select a location for the suppresion and click OK. When suppressions are defined in source code:
    • The same suppressions are applied whenever you or a team member tests that code.
    • You can add code comments for the suppression to further explain the reason you suppressed the rule violation.
    • You gain fine-grained control over which rules are enforced at the file, class, or line level.
  6. Click the Suppressions tab to view existing suppresions. If the suppressions tab is not visible, select Parasoft> Show View> Suppressions. You will see an entry that corresponds to the specified suppression in the file ATM.cxx.


  • No labels