 
                            ...
In this noncompliant code example, the function counter() increments the global variable count and then returns immediately if this variable exceeds a maximum value.:
| Code Block | ||||
|---|---|---|---|---|
| 
 | ||||
| unsigned int count = 0;
void counter() {
  if (count++ > MAX_COUNT) return;
  /* ... */
}
 | 
...
Noncompliant Code Example (Function Declaration)
In this noncompliant , code example, the function f() is called only called from within the function g(), which is defined in the same compilation unit.   By default, function declarations are extern, meaning that these functions are placed in the global symbol table and are available from other compilation units.
...
In this compliant solution, the function f() is declared as external.   This practice limits the scope of the function declaration to the current compilation unit and prevents the function from being included in the external symbol table.   This It also limits cluttering in the global name space and prevents the function from being accidentally or intentionally invoked from another compilation unit.
...
Search for vulnerabilities resulting from the violation of this rule on the CERT website.
Related Guidelines
...