This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: PATCH: cpp include directory search order warning (mark 3)
- From: Zack Weinberg <zack at codesourcery dot com>
- To: John David Anglin <dave at hiauly1 dot hia dot nrc dot ca>
- Cc: nathan at cs dot bris dot ac dot uk, nathan at codesourcery dot com, gcc-patches at gcc dot gnu dot org
- Date: Tue, 20 Aug 2002 11:47:56 -0700
- Subject: Re: PATCH: cpp include directory search order warning (mark 3)
- References: <3D578235.A93AD600@acm.org> <200208132026.g7DKQo4L029034@hiauly1.hia.nrc.ca>
On Tue, Aug 13, 2002 at 04:26:50PM -0400, John David Anglin wrote:
>
> I added a warning under -v and updated more of the documentation
> to describe the new treatment of -Idir when dir duplicates a system
> directory. I have also implemented a suggestion from Nix regarding
> revising the search in remove_dup_nonsys_dirs. This makes it more
> efficient, although it is less obvious now as to what value is being
> returned.
>
> Tested by inspection of cpp output with -v and a bootstrap-check
> under hppa-linux.
>
> Ok for main?
Please also mention this in the relevant changes.html(s) and address
the minor issues pointed out below, then apply this patch.
Thank you for working through this problem.
Should we consider this patch for 3.2.1?
zw
> +/* Remove duplicate non-system directories for which there is an equivalent
> + system directory latter in the chain. The range for removal is between
> + *HEAD_PTR and END. Returns the directory before END, or NULL if none.
> + This algorithm is quadratic in the number system directories, which is
^ of
> + acceptable since there aren't usually that many of them. */
> + if (CPP_OPTION (pfile, verbose))
> + fprintf (stderr, _(" as it is a non-system directory that duplicates a system directory\n"));
Put the _("...") on its own line and outdent it as far as necessary to
avoid going past 79 columns.
> -left-to-right order, @emph{before} the default directories. You can
> -also prevent GCC from searching any of the default directories with the
> -@option{-nostdinc} option. This is useful when you are compiling an
> +left-to-right order, @emph{before} the default directories. The only
> +exception is when @file{dir} is also a default system directory. In
Change "is also a default system directory" to "is already searched by
default."
> +this case, the option is ignored and the default search order for system
Strike "default" from this line.
...
> +You can prevent GCC from searching any of the default directories with
> +the @option{-nostdinc} option. This is useful when you are compiling an
> operating system kernel or some other program that does not use the
... kernel, some other program ...
> standard C library facilities, or the standard C library itself.
Add:
@option{-I} options are not ignored as described above when
@option{-nostdinc} is in effect.
> All directories named by @option{-isystem} are searched @emph{after} all
> directories named by @option{-I}, no matter what their order was on the
> command line. If the same directory is named by both @option{-I} and
> -@option{-isystem}, @option{-I} wins; it is as if the @option{-isystem} option
> -had never been specified at all. GCC warns you when this happens.
> +@option{-isystem}, the @option{-I} option is ignored. GCC provides an
> +information message when this occurs if @option{-v} is used.
"Informational" or "informative" message, please (your choice)
zw