MISRA.NS.GLOBALDeclaring names into appropriate namespaces reduces the names found during lookup, helping to ensure that the names found meet developer expectations. MISRA-C++ Rule 7-3-1 (required): The global namespace shall only contain main, namespace declarations and extern "C" declarations.RationaleThe types defined for compliance with Rule 3–9–2 may also be in the global namespace.Using directives and declarations may also be in the global namespace. MISRA.NS.GLOBAL.USING is intended for detecting such statements. ExceptionThe types defined for compliance with Rule 3—9—2 may also be in the global namespace. Examplevoid f1 ( int32_t ); // Non-compliant int32_t x1; // Non-compliant namespace { void f2 ( int32_t ); // Compliant int32_t x2; // Compliant } namespace MY_API { void b2 ( int32_t ); // Compliant int32_t x2; // Compliant } int32_t main ( ) // Compliant { } |