This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

-nostdinc doesn't remove all system include paths


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

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]