This is the mail archive of the
mailing list for the GCC project.
Re: [PATCH] Write dependency information (-M*) even if there are errors
- From: Boris Kolpackov <boris at codesynthesis dot com>
- To: Segher Boessenkool <segher at kernel dot crashing dot org>
- Cc: gcc at gcc dot gnu dot org
- Date: Sat, 12 Aug 2017 17:53:44 +0200
- Subject: Re: [PATCH] Write dependency information (-M*) even if there are errors
- Authentication-results: sourceware.org; auth=none
- References: <email@example.com> <20170807111241.GF13471@gate.crashing.org>
Segher Boessenkool <firstname.lastname@example.org> writes:
> Patches should go to gcc-patches.
Ok, will keep in mind for future (seeing that we have a discussion
already it probably doesn't make sense to move this patch).
> Two spaces after a full stop (all three times).
Fixed, new revision included.
--- gcc/c-family/ChangeLog (revision 250514)
+++ gcc/c-family/ChangeLog (working copy)
@@ -1,3 +1,8 @@
+2017-08-06 Boris Kolpackov <email@example.com>
+ * c-opts.c (c_common_finish): Write dependency information even if
+ there are errors.
2017-07-14 David Malcolm <firstname.lastname@example.org>
* c-common.c (try_to_locate_new_include_insertion_point): New
--- gcc/c-family/c-opts.c (revision 250514)
+++ gcc/c-family/c-opts.c (working copy)
@@ -1152,8 +1157,11 @@
FILE *deps_stream = NULL;
- /* Don't write the deps file if there are errors. */
- if (cpp_opts->deps.style != DEPS_NONE && !seen_error ())
+ /* Note that we write the dependencies even if there are errors. This is
+ useful for handling outdated generated headers that now trigger errors
+ (for example, with #error) which would be resolved by re-generating
+ them. In a sense, this complements -MG. */
+ if (cpp_opts->deps.style != DEPS_NONE)
/* If -M or -MM was seen without -MF, default output to the
output stream. */