This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
-nostdinc doesn't remove all system include paths
- From: Alexandre Oliva <aoliva at redhat dot com>
- To: gcc-patches at gcc dot gnu dot org
- Date: 25 Feb 2002 11:31:47 -0300
- Subject: -nostdinc doesn't remove all system include paths
- Organization: GCC Team, Red Hat
The flag -nostdinc is passed to the preprocessor along with -iprefix
and -isystem flags derived from COMPILER_PATH and -B flags. The
preprocessor the can't tell whether such -isystem flags came from the
user or from the gcc driver. IMO, when the user passes -nostdinc to
gcc, it should not pass any -iprefix or -isystem flags to GCC. I'm
still checking whether this might cause problems to the current
unified-tree build infrastructure, and I'll fix any such problems that
this patch exposes, but I think what we're doing right now is wrong.
Does anybody disagree? Ok to install?
Index: gcc/ChangeLog
from Alexandre Oliva <aoliva@redhat.com>
* gcc.c (cpp_unique_options): Omit %I if -nostdinc.
Index: gcc/gcc.c
===================================================================
RCS file: /cvs/gcc/egcs/gcc/gcc.c,v
retrieving revision 1.296
diff -u -p -r1.296 gcc.c
--- gcc/gcc.c 2002/02/25 13:25:07 1.296
+++ gcc/gcc.c 2002/02/25 14:17:53
@@ -662,7 +662,7 @@ static const char *trad_capable_cpp =
static const char *cpp_unique_options =
"%{C:%{!E:%eGNU C does not support -C without using -E}}\
- %{nostdinc*} %{C} %{v} %{I*} %{P} %{$} %I\
+ %{nostdinc*} %{C} %{v} %{I*} %{P} %{$} %{!nostdinc:%I}\
%{MD:-M -MF %W{!o: %b.d}%W{o*:%.d%*}}\
%{MMD:-MM -MF %W{!o: %b.d}%W{o*:%.d%*}}\
%{M} %{MM} %W{MF*} %{MG} %{MP} %{MQ*} %{MT*}\
--
Alexandre Oliva Enjoy Guarana', see http://www.ic.unicamp.br/~oliva/
Red Hat GCC Developer aoliva@{cygnus.com, redhat.com}
CS PhD student at IC-Unicamp oliva@{lsd.ic.unicamp.br, gnu.org}
Free Software Evangelist Professional serial bug killer