Skip to Main Content Skip to Search
Product Documentation

Setting Up Project to Check Coding Rules

Polyspace Coding Rules Checker Overview

Polyspace software can check that your code complies with established C or C++ coding standards. The coding rules checker can check MISRA C, MISRA C++ or JSF++ coding standards.[1]

The Polyspace coding rules checker enables Polyspace software to provide messages when coding rules are not respected. Most messages are reported during the compile phase of a verification.

Checking Compliance with MISRA C Coding Rules

To check MISRA C compliance, you set an option in your project before running a verification. Polyspace software finds the violations during the compile phase of a verification. When you have addressed all MISRA C violations, you run the verification again.

To set the MISRA C checking option:

  1. In the Configuration pane of the Project Manager perspective, select the All Settings tab.

  2. Expand Compliance with standards.

  3. Select the Check MISRA C rules check box.

  4. Expand the Check MISRA C rules node.

  5. Specify coding rule checker options, for example:

    • MISRA C rules to check

    • Files, if any, to exclude from the checking

    • Data types that you want Polyspace to consider as Boolean

Checking Compliance with C++ Coding Rules

To check coding rules compliance, you set an option in your project before running a verification. Polyspace software finds the violations during the compile phase of a verification. When you have addressed all coding rules violations, you run the verification again.

To set the coding rules checking option:

  1. In the Configuration pane of the Project Manager perspective, select the All Settings tab.

  2. Expand the Compliance with standards > Coding rules checker node.

    The software displays the coding rules options: -jsf-coding-rules , -misra-cpp, and -includes-to-ignore.

    These options allow you to specify which rules to check and any files to exclude from the checker.

  3. Select either the Check JSF C++ rules or Check MISRA C++ rules check box.

  4. Specify which rules to check and which, if any, files to exclude from the checking.


[1] MISRA and MISRA C are registered trademarks of MISRA Ltd., held on behalf of the MISRA Consortium.

  


 © 1984-2012- The MathWorks, Inc.    -   Site Help   -   Patents   -   Trademarks   -   Privacy Policy   -   Preventing Piracy   -   RSS