This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: New warning: -Wmissing-include-dirs


Ben Elliston <bje@au.ibm.com> writes:

> Re-sending for Zack Weinberg to review (sorry for the noise).
>
>> A number of people have asked about such a warning, so I have
>> implemented it.  Users are frequently bitten by -I switches that refer
>> to non-existent directories, leading to incorrect header files (of the
>> same name) being picked up from later in the include path.  This is
>> best used in conjunction with -Werror to halt a built.
>> 
>> I've included documentation and a test case.  Okay for mainline?
>> 
>> 2004-05-13  Ben Elliston  <bje@au.ibm.com>
>> 
>> 	* 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.

OK.

zw


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]