MISRAC++2023-6.7.2 (C++ only)
In this section:
Synopsis
(Required) Global variables shall not be used
Enabled by default
Yes
Severity/Certainty
Medium/High

Full description
Found a global variable
Coding standards
This check does not correspond to any coding standard rules.
Code examples
The following code example fails the check and will give a warning:
int global_var = 1;
The following code example passes the check and will not give a warning about this issue:
const int global_constant = 1;