Miscellaneous-NoStaticInHeader

Do not put static declarations into header files

Required inputs: IR

Static declarations should only be used in implementation files for objects/functions that are used locally within that implementation file.

Functions declared in header files should have external linkage, and should be defined in the corresponding implementation file.

Possible Messages

Key

Text

Severity

Disabled

static_function_in_header

Static declaration in header file.

None

False

static_variable_in_header

Static declaration in header file.

None

False

Options

allow_static_const_in_cpp

allow_static_const_in_cpp : bool = True

If true, const globals in C++ (which are implicitly static) are tolerated.
 

allow_static_inline

allow_static_inline : bool = True

Whether static inline functions are allowed in header files.