Commit 4bed3787 by Mike Stump Committed by Mike Stump

invoke.texi (Directory Options): Document -iquote.

	* 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: Likewise.
	* doc/cpp.texi: Likewise.
	* doc/cppopts.texi: Likewise.

From-SVN: r81521
parent bb8a619e
2004-05-3 Mike Stump <mrs@apple.com>
* 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: Likewise.
* doc/cpp.texi: Likewise.
* doc/cppopts.texi: Likewise.
2004-05-05 Steven Bosscher <stevenb@suse.de> 2004-05-05 Steven Bosscher <stevenb@suse.de>
* basic-block.h (free_basic_block_vars): Update prototype. * basic-block.h (free_basic_block_vars): Update prototype.
......
...@@ -171,6 +171,7 @@ add_standard_paths (const char *sysroot, const char *iprefix, int cxx_stdinc) ...@@ -171,6 +171,7 @@ add_standard_paths (const char *sysroot, const char *iprefix, int cxx_stdinc)
JOIN, unless it duplicates JOIN in which case the last path is JOIN, unless it duplicates JOIN in which case the last path is
removed. Return the head of the resulting chain. Any of HEAD, removed. Return the head of the resulting chain. Any of HEAD,
JOIN and SYSTEM can be NULL. */ JOIN and SYSTEM can be NULL. */
static struct cpp_dir * static struct cpp_dir *
remove_duplicates (cpp_reader *pfile, struct cpp_dir *head, remove_duplicates (cpp_reader *pfile, struct cpp_dir *head,
struct cpp_dir *system, struct cpp_dir *join, struct cpp_dir *system, struct cpp_dir *join,
...@@ -243,9 +244,10 @@ remove_duplicates (cpp_reader *pfile, struct cpp_dir *head, ...@@ -243,9 +244,10 @@ remove_duplicates (cpp_reader *pfile, struct cpp_dir *head,
We can't just merge the lists and then uniquify them because then We can't just merge the lists and then uniquify them because then
we may lose directories from the <> search path that should be we may lose directories from the <> search path that should be
there; consider -Ifoo -Ibar -I- -Ifoo -Iquux. It is however safe there; consider -iquote foo -iquote bar -Ifoo -Iquux. It is
to treat -Ibar -Ifoo -I- -Ifoo -Iquux as if written -Ibar -I- -Ifoo however safe to treat -iquote bar -iquote foo -Ifoo -Iquux as if
-Iquux. */ written -iquote bar -Ifoo -Iquux. */
static void static void
merge_include_chains (cpp_reader *pfile, int verbose) merge_include_chains (cpp_reader *pfile, int verbose)
{ {
......
...@@ -162,6 +162,7 @@ c_common_missing_argument (const char *opt, size_t code) ...@@ -162,6 +162,7 @@ c_common_missing_argument (const char *opt, size_t code)
case OPT_idirafter: case OPT_idirafter:
case OPT_isysroot: case OPT_isysroot:
case OPT_isystem: case OPT_isystem:
case OPT_iquote:
error ("missing path after \"%s\"", opt); error ("missing path after \"%s\"", opt);
break; break;
...@@ -303,6 +304,7 @@ c_common_handle_option (size_t scode, const char *arg, int value) ...@@ -303,6 +304,7 @@ c_common_handle_option (size_t scode, const char *arg, int value)
error ("-I- specified twice"); error ("-I- specified twice");
quote_chain_split = true; quote_chain_split = true;
split_quote_chain (); split_quote_chain ();
inform ("obsolete option -I- used, please use -iquote instead");
} }
break; break;
...@@ -954,6 +956,10 @@ c_common_handle_option (size_t scode, const char *arg, int value) ...@@ -954,6 +956,10 @@ c_common_handle_option (size_t scode, const char *arg, int value)
iprefix = arg; iprefix = arg;
break; break;
case OPT_iquote:
add_path (xstrdup (arg), QUOTE, 0);
break;
case OPT_isysroot: case OPT_isysroot:
sysroot = arg; sysroot = arg;
break; break;
......
...@@ -103,7 +103,7 @@ Print the name of header files as they are used ...@@ -103,7 +103,7 @@ Print the name of header files as they are used
I I
C ObjC C++ ObjC++ Joined Separate C ObjC C++ ObjC++ Joined Separate
-I <dir> Add <dir> to the end of the main include path. -I- gives more include path control; see info documentation -I <dir> Add <dir> to the end of the main include path
M M
C ObjC C++ ObjC++ C ObjC C++ ObjC++
...@@ -720,6 +720,10 @@ isystem ...@@ -720,6 +720,10 @@ isystem
C ObjC C++ ObjC++ Joined Separate C ObjC C++ ObjC++ Joined Separate
-isystem <dir> Add <dir> to the start of the system include path -isystem <dir> Add <dir> to the start of the system include path
iquote
C ObjC C++ ObjC++ Joined Separate
-iquote <dir> Add <dir> to the end of the quote include path
iwithprefix iwithprefix
C ObjC C++ ObjC++ Joined Separate C ObjC C++ ObjC++ Joined Separate
-iwithprefix <dir> Add <dir> to the end of the system include path -iwithprefix <dir> Add <dir> to the end of the system include path
......
...@@ -759,9 +759,11 @@ named @var{file} in a standard list of system directories. You can prepend ...@@ -759,9 +759,11 @@ named @var{file} in a standard list of system directories. You can prepend
directories to this list with the @option{-I} option (@pxref{Invocation}). directories to this list with the @option{-I} option (@pxref{Invocation}).
@item #include "@var{file}" @item #include "@var{file}"
This variant is used for header files of your own program. It searches This variant is used for header files of your own program. It
for a file named @var{file} first in the directory containing the searches for a file named @var{file} first in the directory containing
current file, then in the same directories used for @code{<@var{file}>}. 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 @end table
The argument of @samp{#include}, whether delimited with quote marks or The argument of @samp{#include}, whether delimited with quote marks or
...@@ -883,9 +885,10 @@ standard C library facilities, or the standard C library itself. ...@@ -883,9 +885,10 @@ standard C library facilities, or the standard C library itself.
@option{-nostdinc} is in effect. @option{-nostdinc} is in effect.
GCC looks for headers requested with @code{@w{#include "@var{file}"}} GCC looks for headers requested with @code{@w{#include "@var{file}"}}
first in the directory containing the current file, then in the same first in the directory containing the current file, then in the
places it would have looked for a header requested with angle brackets. directories as specified by @option{-iquote} options, then in the same
For example, if @file{/usr/include/sys/stat.h} contains 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 @code{@w{#include "types.h"}}, GCC looks for @file{types.h} first in
@file{/usr/include/sys}, then in its usual search path. @file{/usr/include/sys}, then in its usual search path.
...@@ -898,7 +901,8 @@ This has two effects. First, directories appearing before the ...@@ -898,7 +901,8 @@ This has two effects. First, directories appearing before the
quote marks. Directories after @option{-I-} are searched for all quote marks. Directories after @option{-I-} are searched for all
headers. Second, the directory containing the current file is not headers. Second, the directory containing the current file is not
searched for anything, unless it happens to be one of the directories searched for anything, unless it happens to be one of the directories
named by an @option{-I} switch. 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 @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{""} not cause the same behavior for @samp{<>} includes that @samp{""}
...@@ -4039,6 +4043,11 @@ they generally represent bugs in the snapshots. ...@@ -4039,6 +4043,11 @@ they generally represent bugs in the snapshots.
@itemize @bullet @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 @item Order of evaluation of @samp{#} and @samp{##} operators
The standard does not specify the order of evaluation of a chain of The standard does not specify the order of evaluation of a chain of
...@@ -4131,7 +4140,8 @@ without notice. ...@@ -4131,7 +4140,8 @@ without notice.
@ignore @ignore
@c man begin SYNOPSIS @c man begin SYNOPSIS
cpp [@option{-D}@var{macro}[=@var{defn}]@dots{}] [@option{-U}@var{macro}] cpp [@option{-D}@var{macro}[=@var{defn}]@dots{}] [@option{-U}@var{macro}]
[@option{-I}@var{dir}@dots{}] [@option{-W}@var{warn}@dots{}] [@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{-M}|@option{-MM}] [@option{-MG}] [@option{-MF} @var{filename}]
[@option{-MP}] [@option{-MQ} @var{target}@dots{}] [@option{-MP}] [@option{-MQ} @var{target}@dots{}]
[@option{-MT} @var{target}@dots{}] [@option{-MT} @var{target}@dots{}]
......
...@@ -400,6 +400,7 @@ file directory as the first search directory for @code{@w{#include ...@@ -400,6 +400,7 @@ file directory as the first search directory for @code{@w{#include
@ifset cppmanual @ifset cppmanual
@xref{Search Path}. @xref{Search Path}.
@end ifset @end ifset
This option has been deprecated.
@item -nostdinc @item -nostdinc
@opindex nostdinc @opindex nostdinc
...@@ -466,6 +467,16 @@ is applied to the standard system directories. ...@@ -466,6 +467,16 @@ is applied to the standard system directories.
@xref{System Headers}. @xref{System Headers}.
@end ifset @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 @item -fdollars-in-identifiers
@opindex fdollars-in-identifiers @opindex fdollars-in-identifiers
@anchor{fdollars-in-identifiers} @anchor{fdollars-in-identifiers}
......
...@@ -328,7 +328,7 @@ in the following sections. ...@@ -328,7 +328,7 @@ in the following sections.
@item Directory Options @item Directory Options
@xref{Directory Options,,Options for Directory Search}. @xref{Directory Options,,Options for Directory Search}.
@gccoptlist{-B@var{prefix} -I@var{dir} -I- -L@var{dir} -specs=@var{file}} @gccoptlist{-B@var{prefix} -I@var{dir} -iquote@var{dir} -L@var{dir} -specs=@var{file} -I-}
@item Target Options @item Target Options
@c I wrote this xref this way to avoid overfull hbox. -- rms @c I wrote this xref this way to avoid overfull hbox. -- rms
...@@ -5263,28 +5263,12 @@ the ordering for the include_next directive are not inadvertently changed. ...@@ -5263,28 +5263,12 @@ the ordering for the include_next directive are not inadvertently changed.
If you really need to change the search order for system directories, If you really need to change the search order for system directories,
use the @option{-nostdinc} and/or @option{-isystem} options. use the @option{-nostdinc} and/or @option{-isystem} options.
@item -I- @item -iquote@var{dir}
@opindex I- @opindex iquote
Any directories you specify with @option{-I} options before the @option{-I-} Add the directory @var{dir} to the head of the list of directories to
option are searched only for the case of @samp{#include "@var{file}"}; be searched for header files only for the case of @samp{#include
they are not searched for @samp{#include <@var{file}>}. "@var{file}"}; they are not searched for @samp{#include <@var{file}>},
otherwise just like @option{-I}.
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} @item -L@var{dir}
@opindex L @opindex L
...@@ -5342,6 +5326,31 @@ program uses when determining what switches to pass to @file{cc1}, ...@@ -5342,6 +5326,31 @@ program uses when determining what switches to pass to @file{cc1},
@file{cc1plus}, @file{as}, @file{ld}, etc. More than one @file{cc1plus}, @file{as}, @file{ld}, etc. More than one
@option{-specs=@var{file}} can be specified on the command line, and they @option{-specs=@var{file}} can be specified on the command line, and they
are processed in order, from left to right. 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 @end table
@c man end @c man end
......
...@@ -48,8 +48,8 @@ struct spec_function ...@@ -48,8 +48,8 @@ struct spec_function
|| !strcmp (STR, "imacros") || !strcmp (STR, "aux-info") \ || !strcmp (STR, "imacros") || !strcmp (STR, "aux-info") \
|| !strcmp (STR, "idirafter") || !strcmp (STR, "iprefix") \ || !strcmp (STR, "idirafter") || !strcmp (STR, "iprefix") \
|| !strcmp (STR, "iwithprefix") || !strcmp (STR, "iwithprefixbefore") \ || !strcmp (STR, "iwithprefix") || !strcmp (STR, "iwithprefixbefore") \
|| !strcmp (STR, "isystem") || !strcmp (STR, "-param") \ || !strcmp (STR, "iquote") || !strcmp (STR, "isystem") \
|| !strcmp (STR, "specs") \ || !strcmp (STR, "-param") || !strcmp (STR, "specs") \
|| !strcmp (STR, "MF") || !strcmp (STR, "MT") || !strcmp (STR, "MQ")) || !strcmp (STR, "MF") || !strcmp (STR, "MT") || !strcmp (STR, "MQ"))
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment