Skip to content

Commit 5985bf8

Browse files
facchinmcmaglie
authored andcommitted
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)
1 parent f3748a5 commit 5985bf8

File tree

1 file changed

+0
-5
lines changed

1 file changed

+0
-5
lines changed

Diff for: container_find_includes.go

-5
Original file line numberDiff line numberDiff line change
@@ -343,11 +343,6 @@ func findIncludesUntilDone(ctx *types.Context, cache *includeCache, sourceFile t
343343
return i18n.WrapError(preproc_err)
344344
} else {
345345
include = IncludesFinderWithRegExp(ctx, string(preproc_stderr))
346-
if include == "" {
347-
// No include found? Bail out.
348-
os.Stderr.Write(preproc_stderr)
349-
return i18n.WrapError(preproc_err)
350-
}
351346
}
352347
}
353348

0 commit comments

Comments
 (0)