aboutsummaryrefslogtreecommitdiff
path: root/gcc/c-opts.c
diff options
context:
space:
mode:
authorBen Elliston <bje@au.ibm.com>2004-05-22 02:39:35 +0000
committerBen Elliston <bje@au.ibm.com>2004-05-22 02:39:35 +0000
commit13ae633943d502d34d110f70d7cb5d308bd4e06d (patch)
tree0fb35652621330c19f8e8ce0ffeb987cb15f69d5 /gcc/c-opts.c
parent605c7e7258d0031a68e0be66926708a6e415fe8d (diff)
* c.opt (Wmissing-include-dirs): New.
* c-opts.c (c_common_handle_option): Pass true for user_supplied_p to add_path () for -I, but false for OPT_idirafter, OPT_iquote and OPT_isystem. Handle case OPT_Wmissing_include_dirs. * c-incpath.h (add_path): Add fourth (bool) argument. * c-incpath.c (add_env_var_paths): Pass false to add_path (). (add_standard_paths): Likewise. (remove_duplicates) [REASON_NOENT]: Warn if -Wmissing-include-dirs is used and the directory was user-supplied via -I. (add_path): Set p->user_supplied_p. Remove duplicated code by using add_cpp_dir_path (). * cpplib.h (struct cpp_options): Add warn_missing_include_dirs. (struct cpp_dir): Add user_supplied_p. * doc/invoke.texi (Warning Options): Document new option. [testsuite] * gcc.dg/cpp/Wmissingdirs.c: New. git-svn-id: https://gcc.gnu.org/svn/gcc/trunk@82121 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/c-opts.c')
-rw-r--r--gcc/c-opts.c14
1 files changed, 9 insertions, 5 deletions
diff --git a/gcc/c-opts.c b/gcc/c-opts.c
index 1300b69cd0b..47c702474c7 100644
--- a/gcc/c-opts.c
+++ b/gcc/c-opts.c
@@ -297,7 +297,7 @@ c_common_handle_option (size_t scode, const char *arg, int value)
case OPT_I:
if (strcmp (arg, "-"))
- add_path (xstrdup (arg), BRACKET, 0);
+ add_path (xstrdup (arg), BRACKET, 0, true);
else
{
if (quote_chain_split)
@@ -541,6 +541,10 @@ c_common_handle_option (size_t scode, const char *arg, int value)
warn_missing_format_attribute = value;
break;
+ case OPT_Wmissing_include_dirs:
+ cpp_opts->warn_missing_include_dirs = value;
+ break;
+
case OPT_Wmissing_prototypes:
warn_missing_prototypes = value;
break;
@@ -939,7 +943,7 @@ c_common_handle_option (size_t scode, const char *arg, int value)
break;
case OPT_idirafter:
- add_path (xstrdup (arg), AFTER, 0);
+ add_path (xstrdup (arg), AFTER, 0, true);
break;
case OPT_imacros:
@@ -952,7 +956,7 @@ c_common_handle_option (size_t scode, const char *arg, int value)
break;
case OPT_iquote:
- add_path (xstrdup (arg), QUOTE, 0);
+ add_path (xstrdup (arg), QUOTE, 0, true);
break;
case OPT_isysroot:
@@ -960,7 +964,7 @@ c_common_handle_option (size_t scode, const char *arg, int value)
break;
case OPT_isystem:
- add_path (xstrdup (arg), SYSTEM, 0);
+ add_path (xstrdup (arg), SYSTEM, 0, true);
break;
case OPT_iwithprefix:
@@ -1390,7 +1394,7 @@ add_prefixed_path (const char *suffix, size_t chain)
memcpy (path + prefix_len, suffix, suffix_len);
path[prefix_len + suffix_len] = '\0';
- add_path (path, chain, 0);
+ add_path (path, chain, 0, false);
}
/* Handle -D, -U, -A, -imacros, and the first -include. */