In some situations a source file includes a header file which is not a stand-alone header file: it includes other header files that are part of the interface of the top header file. An example of this is windows.h
. This header file not only declares a lot of stuff, but also includes other headers. These other headers are not meant to be included directly, but only through windows.h
. Within IncludeChecker header files like windows.h
are called interface headers.
To tell IncludeChecker that a certain header is an interface header, you can pass the path to that header on the command line with the --interfaceheader
option (see Command line options), or add an <interface_header>
element in the configuration XML (see Configuration XML). IncludeChecker will then not only parse that header, but read all its includes recursively as well and mark all tags found in those headers as belonging to the interface header.
An other example of an interface header is where a header is used as a platform-independent include, which then includes the platform-dependent headers:
~~~~~~~~
// Graphics.h - platform-independent graphics header
#include <GraphicsWin32.h>
#include <GraphicsLinux.h>
#include <GraphicsAndroid.h>
#error "Unsupported platform"
~~~~~~~~~