aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorRobert Spier <rspier@pobox.com>2002-05-08 21:21:19 +0000
committerNeil Booth <neil@gcc.gnu.org>2002-05-08 21:21:19 +0000
commit3f8ffc7cffc8ac2ce106921ad7e9f79adf96de93 (patch)
treefa302bee2149e8e46598f7b0c14b6969a2a3415d /gcc
parentb9e2d17b40af155da708201a231836c1930fe152 (diff)
downloadgcc-3f8ffc7cffc8ac2ce106921ad7e9f79adf96de93.zip
gcc-3f8ffc7cffc8ac2ce106921ad7e9f79adf96de93.tar.gz
gcc-3f8ffc7cffc8ac2ce106921ad7e9f79adf96de93.tar.bz2
re PR preprocessor/6521 (-MG creates dependency with wrong path)
PR preprocessor/6521 * cppfiles.c (handle_missing_header): Don't do anything different for <> includes. doc: * cppopts.texi: Update documentation for -MG. Co-Authored-By: Neil Booth <neil@daikokuya.demon.co.uk> From-SVN: r53304
Diffstat (limited to 'gcc')
-rw-r--r--gcc/ChangeLog9
-rw-r--r--gcc/cppfiles.c25
-rw-r--r--gcc/doc/cppopts.texi11
3 files changed, 17 insertions, 28 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 3b3bede..7b47c8c 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,12 @@
+2002-05-08 Robert Spier <rspier@pobox.com>
+ Neil Booth <neil@daikokuya.demon.co.uk>
+
+ PR preprocessor/6521
+ * cppfiles.c (handle_missing_header): Don't do anything
+ different for <> includes.
+doc:
+ * cppopts.texi: Update documentation for -MG.
+
2002-05-08 Neil Booth <neil@daikokuya.demon.co.uk>
* cpplex.c (cpp_interpret_charconst): Truncate as well as
diff --git a/gcc/cppfiles.c b/gcc/cppfiles.c
index 7600523..70ac978 100644
--- a/gcc/cppfiles.c
+++ b/gcc/cppfiles.c
@@ -658,30 +658,7 @@ handle_missing_header (pfile, fname, angle_brackets)
int print_dep = CPP_PRINT_DEPS(pfile) > (angle_brackets || pfile->map->sysp);
if (CPP_OPTION (pfile, print_deps_missing_files) && print_dep)
- {
- if (!angle_brackets || IS_ABSOLUTE_PATHNAME (fname))
- deps_add_dep (pfile->deps, fname);
- else
- {
- /* If requested as a system header, assume it belongs in
- the first system header directory. */
- struct search_path *ptr = CPP_OPTION (pfile, bracket_include);
- char *p;
- int len = 0, fname_len = strlen (fname);
-
- if (ptr)
- len = ptr->len;
-
- p = (char *) alloca (len + fname_len + 2);
- if (len)
- {
- memcpy (p, ptr->name, len);
- p[len++] = '/';
- }
- memcpy (p + len, fname, fname_len + 1);
- deps_add_dep (pfile->deps, p);
- }
- }
+ deps_add_dep (pfile->deps, fname);
/* If -M was specified, then don't count this as an error, because
we can still produce correct output. Otherwise, we can't produce
correct output, because there may be dependencies we need inside
diff --git a/gcc/doc/cppopts.texi b/gcc/doc/cppopts.texi
index 68bd439..7a2ce50 100644
--- a/gcc/doc/cppopts.texi
+++ b/gcc/doc/cppopts.texi
@@ -204,10 +204,13 @@ When used with the driver options @option{-MD} or @option{-MMD},
@item -MG
@opindex MG
-When used with @option{-M} or @option{-MM}, @option{-MG} says to treat missing
-header files as generated files and assume they live in the same
-directory as the source file. It suppresses preprocessed output, as a
-missing header file is ordinarily an error.
+In conjunction with an option such as @option{-M} requesting
+dependency generation, @option{-MG} assumes missing header files are
+generated files and adds them to the dependency list without raising
+an error. The dependency filename is taken directly from the
+@code{#include} directive without prepending any path. @option{-MG}
+also suppresses preprocessed output, as a missing header file renders
+this useless.
This feature is used in automatic updating of makefiles.