Code snippet and violation:
header.h
class MY_CLASS
{
private:
static bool sm_LoggingEnabled;
};
header.cpp
#include "header.h"
bool MY_CLASS::sm_LoggingEnabled = false;
Violation raised:
8.8 The static storage class specifier shall be used in all declarations of objects and functions that have internal linkage
If I add static in cpp the GCC compiler shows this warning:
warning: 'static' may not be used when defining (as opposed to declaring) a static data member [-fpermissive]
We cannot use inline as we are using C+11.
@kennethctdmn Since this is a C only check, let's just ignore classes.
Code snippet and violation:
header.h
header.cpp
Violation raised:
8.8 The static storage class specifier shall be used in all declarations of objects and functions that have internal linkage
If I add static in cpp the GCC compiler shows this warning:
warning: 'static' may not be used when defining (as opposed to declaring) a static data member [-fpermissive]
We cannot use inline as we are using C+11.
@kennethctdmn Since this is a C only check, let's just ignore classes.