code-base-investigator
code-base-investigator copied to clipboard
Introduce meta-warnings
Related issues
Closes #108.
Proposed changes
- Introduce a
MetaWarningclass that describes a meta-warning message and the condition(s) in which it should be generated. This is currently a regular expression, since our warning messages are not standardized. If we introduce flags like-Wmissing-user-includeand-Wmissing-system-include, we could search for those strings in warnings instead. - Introduce a
WarningAggregatorclass that acts as alogging.Filter; it reads every record written to the log, and checks if it satisfies the condition(s) for anyMetaWarning(s). - Generate the meta-warnings after preprocessing has completed.
Here's an example of the current output from a real run, to help you make sense of the horrible string formatting:
[WARNING ] 4443 warnings generated during preprocessing.
[WARNING ] 131 user include files could not be found.
These could contain important macros and includes.
Suggested solutions:
- Check that the file(s) exist in the code base.
- Check the include paths in the compilation database.
- Check if the include(s) should have used '<>'.
[WARNING ] 4312 system include files could not be found.
These could define important feature macros.
Suggested solutions:
- Check that the file(s) exist on your system.
- Use .cbi/config to define system include paths.
- Use .cbi/config to define important macros.