Synopsis: | Identifiers with file scope shall be declared static, thus preventing them from having global scope. |
Language: | C |
Severity Level: | 4 |
Category: | Declarations |
Description: |
Justification Giving identifiers wider scope than is necessary can easily lead to problems and reduces re-usability. Example bool dbl_equal(double a, double b); /* global scope */ static int ccbb_compare(int i1, int i2); /* file scope */ int ccbb_public; /* external scope */ static int ccbb_private; /* file scope */ |