JavaScript is not currently enabled, but is required for full CodeSonar manual search and browse functionality.
If you are viewing this file in your hub's Web GUI, enable JavaScript in your browser: you will also need it for GUI functionality.
If you opened this file directly from disk, your browser may be directly suppressing JavaScript functionality: certain browsers perform this suppression on local files (but not files delivered by web servers) for security reasons.
| CodeSonar® 9.0p0 Hot Tips | CONFIDENTIAL | CodeSecure Inc |
A variable that requires only local static scope has been declared with larger scope.
Note: When configuration file parameter SCOPE_CHECK_SUGGESTS_LOCAL_STATIC is set to No, Scope Could Be Local Static warnings are not issued. Instead, global static variables that could be local static are reported as Scope Could Be File Static, and file static variables that could be local static are not reported at all.
| Class Name | Scope Could Be Local Static | ||||||||||||||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Significance | style | ||||||||||||||||||||||||||||||||||||||||||||||||
| Mnemonic | LANG.STRUCT.SCOPE.LOCAL | ||||||||||||||||||||||||||||||||||||||||||||||||
| Categories |
|
||||||||||||||||||||||||||||||||||||||||||||||||
| Availability | Available for C and C++. |
||||||||||||||||||||||||||||||||||||||||||||||||
| Enabling | Checks for this warning class are
disabled by default. To enable them, add the following WARNING_FILTER
rule to the project configuration file.
WARNING_FILTER += allow class="Scope Could Be Local Static" |
int myint = 5; /* 'Scope Could Be Local Static' warning issued here */ /* ... */ /* code that does not use myint */ int modify_int(int i){ return i + myint; } /* ... */ /* code that does not use myint */
The following configuration file parameters affect checks for this warning class.