MISRA.TYPE.NAMECLASHType and variable/function with the same name. MISRA-C Rule 5.6 (advisory): No identifier in one name space should have the same spelling as an identifier in another name space, with the exception of structure member and union member names.Name space and scope are different. This rule is not concerned with scope. For example, ISO C allows the same identifier '(vector)' for both a tag and a typedef at the same scope. Exampletypedef struct vector { uint16_t x ; uint16_t y; uint16_t z; } vector; /* Rule violation ^^ ^^ */ ISO C defines a number of different name spaces (see ISO/IEC 9899:1990 6.1.2.3 [2]). It is technically possible to use the same name in separate name spaces to represent completely different items. However this practice is deprecated because of the confusion it can cause, and so names should not be reused, even in separate name spaces. The example below illustrates a violation of this rule in which 'value' is inadvertently used instead of 'record.value': struct { int16_t key; int16_t value; } record; int16_t value; /* Rule violation - second use of value */ record.key = 1; value = 0; /* should have been record.value */ By contrast, the example below does not violate the rule because two member names are less likely to be confused: struct device_q { struct device_q *next; /* ... */ } devices[N_DEVICES]; struct task_q { struct task_q *next; /* ... */ } tasks[N_TASKS]; devices[0].next = &devices[1]; tasks[0].next = &tasks[1]; MISRA-C++ Rule 2-10-6 (required): If an identifier refers to a type, it shall not also refer to an object or a function in the same scope.RationaleFor C compatibility, it is possible in C++ for a name to refer to both a type and object or a type and function. This can lead to confusion. Exampletypedef struct vector { uint16_t x ; uint16_t y; uint16_t z; } vector; // Non-compliant ^^ Non-compliant ^^ struct vector { uint16_t x ; uint16_t y; uint16_t z; } vector; // Non-compliant ^^ Non-compliant ^^ |