Use the Check Headers Tool to manage C/C++ include statements
latestThe Check Headers Tool is used to audit C/C++ source and header files to ensure two specific properties are met:
- Completeness: All necessary headers are explicitly included in the file, rather than relying on transitive includes (where one header includes another).
- Cleanliness: There are no unnecessary header includes present in the file.
Maintaining these properties helps keep compile times manageable and prevents complicated header interdependencies.
The tool operates using manifest files (e.g., standard_library.yml) which map specific code terms to their required headers. For example, if a file uses NULL, the tool checks the manifest to ensure either stddef.h or cstddef is included.