From a94d16c6119280b3850c9e66252500f7ed1d990e Mon Sep 17 00:00:00 2001 From: Jim Wilson Date: Tue, 6 Apr 1993 12:32:37 -0700 Subject: (do_include): For missing header file... (do_include): For missing header file, if -M, don't output dependencies, and warning not error if no dependency is needed. From-SVN: r4033 --- gcc/cccp.c | 34 +++++++++------------------------- 1 file changed, 9 insertions(+), 25 deletions(-) (limited to 'gcc') diff --git a/gcc/cccp.c b/gcc/cccp.c index 02a2704..bcc583e 100644 --- a/gcc/cccp.c +++ b/gcc/cccp.c @@ -3984,34 +3984,18 @@ get_filename: strncpy (fname, fbeg, flen); fname[flen] = 0; - if (search_start) + /* If -M was specified, and this header file won't be added to the + dependency list, 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 the missing + file, and we don't know what directory this missing file exists in. */ + if (print_deps + && (print_deps <= (angle_brackets || (system_include_depth > 0)))) + warning ("No include path in which to find %s", fname); + else if (search_start) error_from_errno (fname); else error ("No include path in which to find %s", fname); - - /* For -M, add this file to the dependencies. */ - if (print_deps > (angle_brackets || (system_include_depth > 0))) { - /* Break the line before this. */ - deps_output ("", 0); - - /* If it was requested as a system header file, - then assume it belongs in the first place to look for such. */ - if (angle_brackets) { - for (searchptr = search_start; searchptr; searchptr = searchptr->next) { - if (searchptr->fname) { - if (searchptr->fname[0] == 0) - continue; - deps_output (searchptr->fname, 0); - deps_output ("/", 0); - break; - } - } - } - /* Otherwise, omit the directory, as if the file existed - in the directory with the source. */ - deps_output (fbeg, flen); - deps_output (" ", 0); - } } else { struct stat stat_f; -- cgit v1.1