TICS Coding Standard Viewer 
TIOBE Software Quality Framework
Print-friendly version
©TIOBE Software www.tiobe.com
 
ASML C Coding Standard
Search

Rule:  6.2.3.aChecked automatically with code checker

Synopsis:To avoid name collision, one shall not use the same name for different identifiers.
Language:C
Severity Level:2
Category:Concepts


Description:

Justification

Re-declaration of identifiers results in confusing code, even if the identifiers belong to different name spaces. Using the same name may confuse the reader.

Example

int value;
/* ... */
{
    float value; /* WRONG: obscures earlier 'value' */
    /* ... */
}    
/* ... */

Note

The gcc compiler option "-Wshadow" is able to check this rule. This also accounts for an identifier declared as typedef.