2004-05-3 Mike Stump * doc/invoke.texi (Directory Options): Document -iquote. * doc/cpp.texi: Likewise. * doc/cppopts.texi: Likewise. * c-opts.c (c_common_missing_argument): Add -iquote processing. (c_common_handle_option): Likewise. * c.opt (iquote): Add. * gcc.h (DEFAULT_WORD_SWITCH_TAKES_ARG): Add -iquote. * c-incpath.c (merge_include_chains): Update comment to use -iquote. * c-opts.c (case OPT_I): Deprecate -I- support. * doc/invoke.texi: Deprecate -I- support. * doc/cpp.texi: Likewise. * doc/cppopts.texi: Likewise. Doing diffs in .: *** ./c-incpath.c.~1~ Tue Mar 23 18:32:56 2004 --- ./c-incpath.c Tue May 4 14:24:11 2004 *************** add_standard_paths (const char *sysroot, *** 171,176 **** --- 171,177 ---- JOIN, unless it duplicates JOIN in which case the last path is removed. Return the head of the resulting chain. Any of HEAD, JOIN and SYSTEM can be NULL. */ + static struct cpp_dir * remove_duplicates (cpp_reader *pfile, struct cpp_dir *head, struct cpp_dir *system, struct cpp_dir *join, *************** remove_duplicates (cpp_reader *pfile, st *** 243,251 **** We can't just merge the lists and then uniquify them because then we may lose directories from the <> search path that should be ! there; consider -Ifoo -Ibar -I- -Ifoo -Iquux. It is however safe ! to treat -Ibar -Ifoo -I- -Ifoo -Iquux as if written -Ibar -I- -Ifoo ! -Iquux. */ static void merge_include_chains (cpp_reader *pfile, int verbose) { --- 244,253 ---- We can't just merge the lists and then uniquify them because then we may lose directories from the <> search path that should be ! there; consider -iquote foo -iquote bar -Ifoo -Iquux. It is ! however safe to treat -iquote bar -iquote foo -Ifoo -Iquux as if ! written -iquote bar -Ifoo -Iquux. */ ! static void merge_include_chains (cpp_reader *pfile, int verbose) { *** ./c-opts.c.~1~ Tue Apr 27 15:34:53 2004 --- ./c-opts.c Tue May 4 14:27:58 2004 *************** c_common_missing_argument (const char *o *** 162,167 **** --- 162,168 ---- case OPT_idirafter: case OPT_isysroot: case OPT_isystem: + case OPT_iquote: error ("missing path after \"%s\"", opt); break; *************** c_common_handle_option (size_t scode, co *** 303,308 **** --- 304,310 ---- error ("-I- specified twice"); quote_chain_split = true; split_quote_chain (); + inform ("obsolete option -I- used, please use -iquote instead"); } break; *************** c_common_handle_option (size_t scode, co *** 952,957 **** --- 954,963 ---- case OPT_iprefix: iprefix = arg; + break; + + case OPT_iquote: + add_path (xstrdup (arg), QUOTE, 0); break; case OPT_isysroot: *** ./c.opt.~1~ Tue Mar 23 18:32:57 2004 --- ./c.opt Tue May 4 14:30:50 2004 *************** Print the name of header files as they a *** 103,109 **** I C ObjC C++ ObjC++ Joined Separate ! -I Add to the end of the main include path. -I- gives more include path control; see info documentation M C ObjC C++ ObjC++ --- 103,109 ---- I C ObjC C++ ObjC++ Joined Separate ! -I Add to the end of the main include path M C ObjC C++ ObjC++ *************** C ObjC C++ ObjC++ Joined Separate *** 719,724 **** --- 719,728 ---- isystem C ObjC C++ ObjC++ Joined Separate -isystem Add to the start of the system include path + + iquote + C ObjC C++ ObjC++ Joined Separate + -iquote Add to the end of the quote include path iwithprefix C ObjC C++ ObjC++ Joined Separate *** ./doc/cpp.texi.~1~ Wed Jan 28 17:07:55 2004 --- ./doc/cpp.texi Tue May 4 14:57:58 2004 *************** named @var{file} in a standard list of s *** 759,767 **** directories to this list with the @option{-I} option (@pxref{Invocation}). @item #include "@var{file}" ! This variant is used for header files of your own program. It searches ! for a file named @var{file} first in the directory containing the ! current file, then in the same directories used for @code{<@var{file}>}. @end table The argument of @samp{#include}, whether delimited with quote marks or --- 759,769 ---- directories to this list with the @option{-I} option (@pxref{Invocation}). @item #include "@var{file}" ! This variant is used for header files of your own program. It ! searches for a file named @var{file} first in the directory containing ! the current file, then in the quote directories and then the same ! directories used for @code{<@var{file}>}. You can prepend directories ! to the list of quote directories with the @option{-iquote} option. @end table The argument of @samp{#include}, whether delimited with quote marks or *************** standard C library facilities, or the st *** 883,891 **** @option{-nostdinc} is in effect. GCC looks for headers requested with @code{@w{#include "@var{file}"}} ! first in the directory containing the current file, then in the same ! places it would have looked for a header requested with angle brackets. ! For example, if @file{/usr/include/sys/stat.h} contains @code{@w{#include "types.h"}}, GCC looks for @file{types.h} first in @file{/usr/include/sys}, then in its usual search path. --- 885,894 ---- @option{-nostdinc} is in effect. GCC looks for headers requested with @code{@w{#include "@var{file}"}} ! first in the directory containing the current file, then in the ! directories as specified by @option{-iquote} options, then in the same ! places it would have looked for a header requested with angle ! brackets. For example, if @file{/usr/include/sys/stat.h} contains @code{@w{#include "types.h"}}, GCC looks for @file{types.h} first in @file{/usr/include/sys}, then in its usual search path. *************** This has two effects. First, directorie *** 898,904 **** quote marks. Directories after @option{-I-} are searched for all headers. Second, the directory containing the current file is not searched for anything, unless it happens to be one of the directories ! named by an @option{-I} switch. @option{-I. -I-} is not the same as no @option{-I} options at all, and does not cause the same behavior for @samp{<>} includes that @samp{""} --- 901,908 ---- quote marks. Directories after @option{-I-} are searched for all headers. Second, the directory containing the current file is not searched for anything, unless it happens to be one of the directories ! named by an @option{-I} switch. @option{-I-} is deprecated, -iquote ! should be used instead. @option{-I. -I-} is not the same as no @option{-I} options at all, and does not cause the same behavior for @samp{<>} includes that @samp{""} *************** they generally represent bugs in the sna *** 4039,4044 **** --- 4043,4053 ---- @itemize @bullet + @item -I- deprecated + + This option has been deprecated in 3.5. @option{-iquote} is meant to + replace the need for this option. + @item Order of evaluation of @samp{#} and @samp{##} operators The standard does not specify the order of evaluation of a chain of *************** without notice. *** 4131,4137 **** @ignore @c man begin SYNOPSIS cpp [@option{-D}@var{macro}[=@var{defn}]@dots{}] [@option{-U}@var{macro}] ! [@option{-I}@var{dir}@dots{}] [@option{-W}@var{warn}@dots{}] [@option{-M}|@option{-MM}] [@option{-MG}] [@option{-MF} @var{filename}] [@option{-MP}] [@option{-MQ} @var{target}@dots{}] [@option{-MT} @var{target}@dots{}] --- 4140,4147 ---- @ignore @c man begin SYNOPSIS cpp [@option{-D}@var{macro}[=@var{defn}]@dots{}] [@option{-U}@var{macro}] ! [@option{-I}@var{dir}@dots{}] [@option{-iquote}@var{dir}@dots{}] ! [@option{-W}@var{warn}@dots{}] [@option{-M}|@option{-MM}] [@option{-MG}] [@option{-MF} @var{filename}] [@option{-MP}] [@option{-MQ} @var{target}@dots{}] [@option{-MT} @var{target}@dots{}] *** ./doc/cppopts.texi.~1~ Tue Mar 23 18:33:49 2004 --- ./doc/cppopts.texi Tue May 4 14:44:10 2004 *************** file directory as the first search direc *** 400,405 **** --- 400,406 ---- @ifset cppmanual @xref{Search Path}. @end ifset + This option has been deprecated. @item -nostdinc @opindex nostdinc *************** as a system directory, so that it gets t *** 464,469 **** --- 465,480 ---- is applied to the standard system directories. @ifset cppmanual @xref{System Headers}. + @end ifset + + @item -iquote @var{dir} + @opindex iquote + Search @var{dir} only for header files requested with + @code{@w{#include "@var{file}"}}; they are not searched for + @code{@w{#include <@var{file}>}}, before all directories specified by + @option{-I} and before the standard system directories. + @ifset cppmanual + @xref{Search Path}. @end ifset @item -fdollars-in-identifiers *** ./doc/invoke.texi.~1~ Tue Apr 27 15:35:06 2004 --- ./doc/invoke.texi Tue May 4 14:56:42 2004 *************** in the following sections. *** 328,334 **** @item Directory Options @xref{Directory Options,,Options for Directory Search}. ! @gccoptlist{-B@var{prefix} -I@var{dir} -I- -L@var{dir} -specs=@var{file}} @item Target Options @c I wrote this xref this way to avoid overfull hbox. -- rms --- 328,334 ---- @item Directory Options @xref{Directory Options,,Options for Directory Search}. ! @gccoptlist{-B@var{prefix} -I@var{dir} -iquote@var{dir} -L@var{dir} -specs=@var{file} -I-} @item Target Options @c I wrote this xref this way to avoid overfull hbox. -- rms *************** the ordering for the include_next direct *** 5257,5284 **** If you really need to change the search order for system directories, use the @option{-nostdinc} and/or @option{-isystem} options. ! @item -I- ! @opindex I- ! Any directories you specify with @option{-I} options before the @option{-I-} ! option are searched only for the case of @samp{#include "@var{file}"}; ! they are not searched for @samp{#include <@var{file}>}. ! ! If additional directories are specified with @option{-I} options after ! the @option{-I-}, these directories are searched for all @samp{#include} ! directives. (Ordinarily @emph{all} @option{-I} directories are used ! this way.) ! ! In addition, the @option{-I-} option inhibits the use of the current ! directory (where the current input file came from) as the first search ! directory for @samp{#include "@var{file}"}. There is no way to ! override this effect of @option{-I-}. With @option{-I.} you can specify ! searching the directory which was current when the compiler was ! invoked. That is not exactly the same as what the preprocessor does ! by default, but it is often satisfactory. ! ! @option{-I-} does not inhibit the use of the standard system directories ! for header files. Thus, @option{-I-} and @option{-nostdinc} are ! independent. @item -L@var{dir} @opindex L --- 5257,5268 ---- If you really need to change the search order for system directories, use the @option{-nostdinc} and/or @option{-isystem} options. ! @item -iquote@var{dir} ! @opindex iquote ! Add the directory @var{dir} to the head of the list of directories to ! be searched for header files only for the case of @samp{#include ! "@var{file}"}; they are not searched for @samp{#include <@var{file}>}, ! otherwise just like @option{-I}. @item -L@var{dir} @opindex L *************** program uses when determining what switc *** 5336,5341 **** --- 5320,5350 ---- @file{cc1plus}, @file{as}, @file{ld}, etc. More than one @option{-specs=@var{file}} can be specified on the command line, and they are processed in order, from left to right. + + @item -I- + @opindex I- + This option has been deprecated. Please use @option{-iquote} instead for + @option{-I} directories before the @option{-I-} and remove the @option{-I-}. + Any directories you specify with @option{-I} options before the @option{-I-} + option are searched only for the case of @samp{#include "@var{file}"}; + they are not searched for @samp{#include <@var{file}>}. + + If additional directories are specified with @option{-I} options after + the @option{-I-}, these directories are searched for all @samp{#include} + directives. (Ordinarily @emph{all} @option{-I} directories are used + this way.) + + In addition, the @option{-I-} option inhibits the use of the current + directory (where the current input file came from) as the first search + directory for @samp{#include "@var{file}"}. There is no way to + override this effect of @option{-I-}. With @option{-I.} you can specify + searching the directory which was current when the compiler was + invoked. That is not exactly the same as what the preprocessor does + by default, but it is often satisfactory. + + @option{-I-} does not inhibit the use of the standard system directories + for header files. Thus, @option{-I-} and @option{-nostdinc} are + independent. @end table @c man end *** ./gcc.h.~1~ Tue Mar 23 18:33:11 2004 --- ./gcc.h Fri Apr 30 16:03:25 2004 *************** struct spec_function *** 48,55 **** || !strcmp (STR, "imacros") || !strcmp (STR, "aux-info") \ || !strcmp (STR, "idirafter") || !strcmp (STR, "iprefix") \ || !strcmp (STR, "iwithprefix") || !strcmp (STR, "iwithprefixbefore") \ ! || !strcmp (STR, "isystem") || !strcmp (STR, "-param") \ ! || !strcmp (STR, "specs") \ || !strcmp (STR, "MF") || !strcmp (STR, "MT") || !strcmp (STR, "MQ")) --- 48,55 ---- || !strcmp (STR, "imacros") || !strcmp (STR, "aux-info") \ || !strcmp (STR, "idirafter") || !strcmp (STR, "iprefix") \ || !strcmp (STR, "iwithprefix") || !strcmp (STR, "iwithprefixbefore") \ ! || !strcmp (STR, "iquote") || !strcmp (STR, "isystem") \ ! || !strcmp (STR, "-param") || !strcmp (STR, "specs") \ || !strcmp (STR, "MF") || !strcmp (STR, "MT") || !strcmp (STR, "MQ")) -------------- Doing diffs in .: *** ./htdocs/gcc-3.5/changes.html.~1~ Mon May 3 19:51:39 2004 --- ./htdocs/gcc-3.5/changes.html Tue May 4 14:20:19 2004 *************** *** 30,35 **** --- 30,36 ----
  • GCC no longer accepts the -fwritable-strings option. Use named character arrays when you need a writable string.
  • +
  • -I- has been deprecated. -iquote is meant to replace the need for this option.
  • General Optimizer Improvements

    --------------