You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
For include detection, the preprocessor is run on all source files,
collecting #included filenames from the stderr output, each of which are
then resolved to a library to include. A caching mechanism is used to
only run the preprocessor when needed.
This commit improves the error handling during include detection in a
number of ways:
- When the preprocessor runs succesfully, processing stops for the
current file. Previously, it would always look at stderr to find a
missing include filename and only stop if none was found.
- When the preprocessor fails, but no filename can be found, show the
error preprocessor error. Previously, it would assume that the
process was done and stop processing the file without any error.
- When no library can be found for a missing include, show the stored
error output instead of running the preprocessor again. Previously,
the preprocessor would be run a second time, to (re)generate the
error message.
When the include filename comes from the cache and the preprocessor
was not run yet, it is still run to show its errors to the user. This
should be very rare, as normally changes that cause a cached filename
to become unresolvable to a library also cause the file to be marked
as changed, bypassing the cache. When this does happen, the
preprocessor is now run using `GCCPreprocRunnerForDiscoveringIncludes()`
instead of `GCCPreprocRunner()`, which ensures the preprocessor
command is always exactly the same.
Before this change, there could be specific circumstances where the
first preprocessor run would generate an error, but where the second
run would not show the error and include detection would continue as
if nothing happened. One such circumstance is described in #230.
Signed-off-by: Matthijs Kooijman <[email protected]>
0 commit comments