MISRA.VAR.UNIQUE.STATICIdentifier with static storage specifier clashes with other identifier. MISRA-C Rule 5.5 (advisory): No object or function identifier with static storage duration should be reused.Regardless of scope, no identifier with static storage duration should be re-used across any source files in the system. This includes objects or functions with external linkage and any objects or functions with the static storage class specifier. While the compiler can understand this and is in no way confused, the possibility exists for the user to incorrectly associate unrelated variables with the same name. One example of this confusion is having an identifier name with internal linkage in one file and the same identifier name with external linkage in another file. MISRA-C++ Rule 2—10—5 (advisory): The identifier name of a non-member object or function with static storage duration should not be reused.RationaleRegardless of scope, no identifier with static storage duration should be re-used across any source files in the project. This includes objects or functions with external linkage and any objects or functions with the static storage class specifier. While the compiler can understand this and is in no way confused, the possibility exists for the developer to incorrectly associate unrelated variables with the same name. Examplenamespace NS1 { static int32_t global = 0; } namespace NS2 { void fn ( ) { int32_t global; // Non-compliant } } |