Skip to content

Don't bail out if got include unrelated error while preprocessing #285

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Sep 10, 2018
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
Don't bail out if got include unrelated error while preprocessing
Preprocessing is a bit tricky, since it expects an error to resolve missing includes; to do this, it invokes gcc with -CC flag (https://gcc.gnu.org/onlinedocs/gcc-4.4.0/gcc/Preprocessor-Options.html#Preprocessor-Options) to expand macro AND comments. Since this flag is not used during normal compilation, the errors reported are mostly bogus.

This patch avoids writing the actual (non-include) error on stdout so the compilation can go on and fail on the proper errors (if there's any)
  • Loading branch information
facchinm committed Aug 28, 2018
commit 3212f41162163dfec397ddb6c7fea2317be10724
5 changes: 0 additions & 5 deletions container_find_includes.go
Original file line number Diff line number Diff line change
Expand Up @@ -343,11 +343,6 @@ func findIncludesUntilDone(ctx *types.Context, cache *includeCache, sourceFile t
return i18n.WrapError(preproc_err)
} else {
include = IncludesFinderWithRegExp(ctx, string(preproc_stderr))
if include == "" {
// No include found? Bail out.
os.Stderr.Write(preproc_stderr)
return i18n.WrapError(preproc_err)
}
}
}

Expand Down