Miscellaneous-NoIfdefInHeaderΒΆ

Except for include guards there shall be no #if[n]def or #if in header files

Required inputs: IR

Rationale
The use of #ifdef in header files is problematic, as it can make the preprocessing of the header file depend on the order in which headers are included. This in turn may lead to violations of the One Definition Rule.

Possible Messages

Key

Text

Severity

Disabled

pp_if_in_header

Except for include guards there shall be no #if[n]def or #if in header files.

None

False

Options