メインコンテンツ

Use generated code requirements for MISRA standards (-misra-agc-mode)

R2026b

Check for violations of MISRA C rules and directives that apply to generated code

Since R2026b

Description

Specify whether to use the categorization of MISRA C™ standard that apply to automatically generated code. This option changes which rules are mandatory, required, or advisory. In MISRA C:2025, some rules are categorized as Disapplied when this option is specified.

Set Option

Set the option using one of these methods:

Why Use This Option

Use this option to specify that you are checking for violations of MISRA C standards in generated code. The option modifies the MISRA C subsets so that they are tailored for generated code.

The option does not add or remove rules from the MISRA C rules specified using their corresponding options such as Check MISRA C:2023 (-misra-c-2023) or -misra-c-2025. Instead, it changes the categorization of the rules.

MISRA C:2025
    • D4.5,

    • 2.3, 2.4, 2.5, 2.6, 2.7, 2.8

    • 5.9

    • 13.3

    • 17.5, 17.8

    • 18.5

    • 20.5

    • D1.2,

    • D4.2,

MISRA C:2023
  • These rules are changed to the Advisory category:

    • 5.3

    • 7.1

    • 8.4, 8.5, 8.14

    • 10.1, 10.2, 10.3, 10.4, 10.6, 10.7, 10.8

    • 14.1, 14.4

    • 15.2, 15.3

    • 16.1, 16.2, 16.3, 16.4, 16.5, 16.6, 16.7

    • 20.8

  • These guidelines are changed to the Readability category:

    • Dir 4.5

    • 2.3, 2.4, 2.5, 2.6, 2.7

    • 5.9

    • 7.2, 7.3

    • 9.2, 9.3, 9.5

    • 11.9

    • 13.3

    • 14.2

    • 15.7

    • 17.5, 17.7, 17.8

    • 18.5

    • 20.5

MISRA C:2012
  • These rules are changed to advisory:

    • 5.3

    • 7.1

    • 8.4, 8.5, 8.14

    • 10.1, 10.2, 10.3, 10.4, 10.6, 10.7, 10.8

    • 14.1, 14.4

    • 15.2, 15.3

    • 16.1, 16.2, 16.3, 16.4, 16.5, 16.6, 16.7

    • 20.8

  • These guidelines are changed to readability:

    • Dir 4.5

    • 2.3, 2.4, 2.5, 2.6, 2.7

    • 5.9

    • 7.2, 7.3

    • 9.2, 9.3, 9.5

    • 11.9

    • 13.3

    • 14.2

    • 15.7

    • 17.5, 17.7, 17.8

    • 18.5

    • 20.5

Settings

Off (default)

Use the normal categories (mandatory, required, advisory) for MISRA C coding guideline checking.

On (default for analyses from Simulink®)

Use the generated code categories for MISRA C coding guideline checking.

For analyses started from the Polyspace® Verifier app in Simulink, this settings is the default value.

Dependencies

In the Polyspace Platform user interface, this option is shown only when you select Use custom checkers file.

At the command line, this options is applied only if at least one MISRA C coding rule is activated. To activate MISRA C coding rules in the command line:

Command-Line Information

Use the command -misra-agc-mode in the command line to check for violations of MISRA C rules and directives that apply to generated code.

Parameter: -misra-agc-mode
Default: Off
Example (Bug Finder): polyspace-bug-finder -sources file_name -misra-c-2023 all -misra-agc-mode
Example (Bug Finder Server): polyspace-bug-finder-server -sources file_name -misra-c-2025 all -misra-agc-mode

Version History

Introduced in R2026b