Main Content

Show global variable sharing and usage only (-shared-variables-mode)

Compute global variable sharing and usage without running full analysis

Description

This option affects a Code Prover analysis only.

This option is not available for code generated from MATLAB® code or Simulink® models.

Specify this option to run a less extensive analysis that computes the global variable sharing and usage in your entire application. The analysis does not verify your code for run-time errors. The analysis results also include coding standards violations if you enable coding standards checking, and code metrics if you enable code metrics computation.

Set Option

User interface (desktop products only): In your project configuration, the option is on the Code Prover Verification node.

User interface (Polyspace Platform, desktop products only): In your project configuration, the option is on the Static Analysis tab on the Run Time Errors node. This option is visible only when you verify the whole application. See Dependencies.

Command line and options file: Use the option -shared-variables-mode. See Command-Line Information.

Why Use This Option

You can see global variable sharing and usage without running a full analysis on your entire application that includes run-time error detection. Run-time error detection on an entire application can take a long time.

Settings

On

Polyspace® computes global variable sharing and usage but does not verify your code for run-time errors.

Off (default)

Polyspace runs a full analysis on your code, including run-time error detection.

Dependencies

Tips

  • After you analyze your complete application to see global variable sharing and usage, run a component-by-component Code Prover analysis to detect run-time errors.

  • In the desktop product, you can see all read and write operations on global variables in the Variable Access in Polyspace Desktop User Interface (Polyspace Code Prover) pane.

  • In this less extensive analysis mode, the analysis checks for most but not all coding standards violations, and computes most but not all code metrics.

Command-Line Information

Parameter: -shared-variables-mode
Default: Off
Example (Code Prover): polyspace-code-prover -sources file_name -shared-variables-mode -enable-concurrency-detection
Example (Code Prover Server): polyspace-code-prover-server -sources file_name -shared-variables-mode -enable-concurrency-detection

Version History

Introduced in R2019b