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-intpath.c (register_include_chains): Remove quote_ignores_source_dir. 2004-05-3 Zack Weinberg * c-incpath.c (merge_include_chains): Remove -I- support. (split_quote_chain): Remove. * c-incpath.h (split_quote_chain): Remove. * c-opts.c (quote_chain_split): Remove. (case OPT_I): Remove -I- support. * doc/invoke.texi: Remove -I- support. * doc/cpp.texi: Likewise. * doc/cppopts.texi: Likewise. * gcc.c (option_map): Likewise. * c-intpath.c (quote_ignores_source_dir): Remove. Doing diffs in .: *** ./c-incpath.c.~1~ Tue Mar 23 18:32:56 2004 --- ./c-incpath.c Mon May 3 19:14:33 2004 *************** static struct cpp_dir *remove_duplicates *** 56,62 **** /* Include chains heads and tails. */ static struct cpp_dir *heads[4]; static struct cpp_dir *tails[4]; - static bool quote_ignores_source_dir; enum { REASON_QUIET = 0, REASON_NOENT, REASON_DUP, REASON_DUP_SYS }; /* Free an element of the include chain, possibly giving a reason. */ --- 56,61 ---- *************** add_standard_paths (const char *sysroot, *** 171,176 **** --- 170,176 ---- 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) { --- 243,252 ---- 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) { *************** merge_include_chains (cpp_reader *pfile, *** 285,305 **** } } - /* Use given -I paths for #include "..." but not #include <...>, and - don't search the directory of the present file for #include "...". - (Note that -I. -I- is not the same as the default setup; -I. uses - the compiler's working dir.) */ - void - split_quote_chain (void) - { - heads[QUOTE] = heads[BRACKET]; - tails[QUOTE] = tails[BRACKET]; - heads[BRACKET] = NULL; - tails[BRACKET] = NULL; - /* This is NOT redundant. */ - quote_ignores_source_dir = true; - } - /* Add P to the chain specified by CHAIN. */ void --- 286,291 ---- *************** register_include_chains (cpp_reader *pfi *** 367,373 **** merge_include_chains (pfile, verbose); cpp_set_include_chains (pfile, heads[QUOTE], heads[BRACKET], ! quote_ignores_source_dir); } #ifndef TARGET_EXTRA_INCLUDES --- 353,359 ---- merge_include_chains (pfile, verbose); cpp_set_include_chains (pfile, heads[QUOTE], heads[BRACKET], ! false); } #ifndef TARGET_EXTRA_INCLUDES *** ./c-incpath.h.~1~ Tue Mar 23 18:32:56 2004 --- ./c-incpath.h Mon May 3 16:15:42 2004 *************** You should have received a copy of the G *** 15,21 **** along with this program; if not, write to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ - extern void split_quote_chain (void); extern void add_path (char *, int, int); extern void register_include_chains (cpp_reader *, const char *, const char *, int, int, int); --- 15,20 ---- *** ./c-opts.c.~1~ Tue Apr 27 15:34:53 2004 --- ./c-opts.c Mon May 3 18:45:31 2004 *************** static bool std_inc = true; *** 86,94 **** /* Zero disables the C++-specific standard directories for headers. */ static bool std_cxx_inc = true; - /* If the quote chain has been split by -I-. */ - static bool quote_chain_split; - /* If -Wunused-macros. */ static bool warn_unused_macros; --- 86,91 ---- *************** c_common_missing_argument (const char *o *** 162,167 **** --- 159,165 ---- 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 *** 298,309 **** if (strcmp (arg, "-")) add_path (xstrdup (arg), BRACKET, 0); else ! { ! if (quote_chain_split) ! error ("-I- specified twice"); ! quote_chain_split = true; ! split_quote_chain (); ! } break; case OPT_M: --- 296,302 ---- if (strcmp (arg, "-")) add_path (xstrdup (arg), BRACKET, 0); else ! error ("obsolete option -I- used"); break; case OPT_M: *************** c_common_handle_option (size_t scode, co *** 952,957 **** --- 945,954 ---- 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 Mon May 3 19:16:28 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 Mon May 3 19:37:18 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,917 **** @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. @samp{#line} (@pxref{Line Control}) does not change GCC's idea of the directory containing the current file. - You may put @option{-I-} at any point in your list of @option{-I} options. - This has two effects. First, directories appearing before the - @option{-I-} in the list are searched only for headers requested with - 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{""} - includes get with no special options. @option{-I.} searches the - compiler's current working directory for header files. That may or may - not be the same as the directory containing the current file. - - If you need to look for headers in a directory named @file{-}, write - @option{-I./-}. - There are several more ways to adjust the header search path. They are generally less useful. @xref{Invocation}. @node Once-Only Headers @section Once-Only Headers @cindex repeated inclusion --- 885,908 ---- @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. @samp{#line} (@pxref{Line Control}) does not change GCC's idea of the directory containing the current file. There are several more ways to adjust the header search path. They are generally less useful. @xref{Invocation}. + Versions of gcc prior to 3.5 used to accept @option{-I-} as a special + option, however, this version merely issues an error for that + construct, so if you need to look for headers in a directory named + @file{-}, write @option{-I./-}. + @node Once-Only Headers @section Once-Only Headers @cindex repeated inclusion *************** they generally represent bugs in the sna *** 4039,4044 **** --- 4030,4041 ---- @itemize @bullet + @item -I- obsoleted + + Versions of gcc prior to gcc 3.5 supported a @option{-I-} option, this + version does not. @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{}] --- 4128,4135 ---- @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 Mon May 3 18:39:20 2004 *************** The same as @option{-std=c++98} plus GNU *** 385,406 **** default for C++ code. @end table - @item -I- - @opindex I- - Split the include path. Any directories specified with @option{-I} - options before @option{-I-} are searched only for headers requested with - @code{@w{#include "@var{file}"}}; they are not searched for - @code{@w{#include <@var{file}>}}. If additional directories are - specified with @option{-I} options after the @option{-I-}, those - directories are searched for all @samp{#include} directives. - - In addition, @option{-I-} inhibits the use of the directory of the current - file directory as the first search directory for @code{@w{#include - "@var{file}"}}. - @ifset cppmanual - @xref{Search Path}. - @end ifset - @item -nostdinc @opindex nostdinc Do not search the standard system directories for header files. --- 385,390 ---- *************** is applied to the standard system direct *** 465,470 **** --- 449,468 ---- @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 -I- + @opindex I- + Obsolete option present only in 3.4 and earlier compilers. @item -fdollars-in-identifiers @opindex fdollars-in-identifiers *** ./doc/invoke.texi.~1~ Tue Apr 27 15:35:06 2004 --- ./doc/invoke.texi Mon May 3 19:28:32 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,5273 ---- If you really need to change the search order for system directories, use the @option{-nostdinc} and/or @option{-isystem} options. ! Versions of gcc prior to 3.5 used to accept @option{-I-} as a special ! option, however, this version merely issues an error for that ! construct, so if you need to look for headers in a directory named ! @file{-}, write @option{-I./-}. ! ! @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 **** --- 5325,5335 ---- @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- + Obsolete option present only in 3.4 and earlier compilers. + @option{-iquote} is meant to replace the need for this option. @end table @c man end *** ./gcc.c.~1~ Tue Apr 27 15:34:54 2004 --- ./gcc.c Mon May 3 16:10:03 2004 *************** static const struct option_map option_ma *** 1042,1048 **** {"--force-link", "-u", "a"}, {"--imacros", "-imacros", "a"}, {"--include", "-include", "a"}, - {"--include-barrier", "-I-", 0}, {"--include-directory", "-I", "aj"}, {"--include-directory-after", "-idirafter", "a"}, {"--include-prefix", "-iprefix", "a"}, --- 1042,1047 ---- *** ./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 Mon May 3 19:55:30 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 obsoleted. -iquote is meant to replace the need for this option.
  • General Optimizer Improvements

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