Main Content

Global Variables

Description and example of global variable categories

A Polyspace® Code Prover™ analysis checks global variables in a C/C++ program and determines if the variables are shared between multiple tasks (threads) or unshared.

  • For shared variables, the analysis attempts to prove that the variables are protected from concurrent access.

  • For unshared variables, the analysis determines if the variables are used or unused.

Polyspace Results

Shared variableGlobal variables shared between multiple tasks and protected from concurrent access by the tasks
Potentially unprotected variableGlobal variables shared between multiple tasks but not protected from concurrent access by the tasks
Used non-shared variableGlobal variables used in a single task
Unused variableGlobal variables declared but not used