aboutsummaryrefslogtreecommitdiff
path: root/gcc/cccp.c
diff options
context:
space:
mode:
authorJim Wilson <wilson@gcc.gnu.org>1993-04-06 12:32:37 -0700
committerJim Wilson <wilson@gcc.gnu.org>1993-04-06 12:32:37 -0700
commita94d16c6119280b3850c9e66252500f7ed1d990e (patch)
tree4846c073944c9bc6f8634c6c4e9e38710d4653b0 /gcc/cccp.c
parent677ff44144c9a085fd89f336776cbac272df05cf (diff)
downloadgcc-a94d16c6119280b3850c9e66252500f7ed1d990e.zip
gcc-a94d16c6119280b3850c9e66252500f7ed1d990e.tar.gz
gcc-a94d16c6119280b3850c9e66252500f7ed1d990e.tar.bz2
(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
Diffstat (limited to 'gcc/cccp.c')
-rw-r--r--gcc/cccp.c34
1 files changed, 9 insertions, 25 deletions
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;