#This script is designed to run with Understand - CodeCheck use base qw(Understand::Codecheck); use strict; use constant ERR1 => '"%1" defined in header file.'; sub register_tr_text { my $check = shift; $check->add_tr_text(ERR1); } sub name { 'Definitions in Header Files' } sub description { 'Objects and Functions should not be defined in Header Files.' } sub detailed_description { <<'END_DESC'
Rationale
Header files should be used to declare objects, functions, typedefs, and macros. Header files shall not contain or produce definitions of
objects or functions (or fragment of functions or objects) that occupy storage. This makes it clear that only C/CPP files contain executable
source code and that header files only contain declarations. A header file is defined as any file that is included via the #include directive,
regardless of name or suffix.
Exception
Inline Functions can be defined in the declaration of a class.