Unused variable
Global variables declared but not used
Description
A non-shared unused global variable has the following properties:
The variable is declared in the code.
Polyspace® cannot detect a read or write operation on the variable.
In your verification results, these variables are colored gray on the Source, Results List
and Variable Access panes. On the Source pane,
the coloring is applied to the variable only during declaration. In the Result
Details pane, the variable name appears along with the name of the file
where it is defined (for extern
variables where the definition is not
available, ?extern
is used for file name.)
Note
The software does not display a complete list of unused global variables. Especially, in C++ projects, unused global variables can be suppressed from display.
Examples
Check Information
Language: C | C++ |