This is the mail archive of the 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]

Dependence tracking broke implicit extern "C"

AIX 4.1's system headers are not C++ aware.  However, when compiling a
C Hello World program as C++, it fails to link because printf is

It seems that some recent change in the dependence generators has
started treating the sysp flag as a boolean, instead of as a tri-state
variable, in which 0 indicates a user header; 1, a system header and
2, a system header implicitly extern "C".

This patch fixes it.  Tested on AIX 4.1 with the latest snapshot.  Ok
to install?

Index: gcc/ChangeLog
from  Alexandre Oliva  <>
	* cppfiles.c (stack_include_file): Use MAX of sysp.

Index: gcc/cppfiles.c
RCS file: /cvs/gcc/egcs/gcc/cppfiles.c,v
retrieving revision
diff -u -p -r1.101.4.3 cppfiles.c
--- gcc/cppfiles.c 2001/02/28 22:46:34
+++ gcc/cppfiles.c 2001/03/08 15:01:20
@@ -273,8 +273,8 @@ stack_include_file (pfile, inc)
   /* We'll try removing deps_sysp after the release of 3.0.  */
   deps_sysp = pfile->system_include_depth != 0;
-  sysp = ((pfile->buffer && pfile->buffer->sysp)
-	  || (inc->foundhere && inc->foundhere->sysp));
+  sysp = MAX ((pfile->buffer ? pfile->buffer->sysp : 0),
+	      (inc->foundhere ? inc->foundhere->sysp : 0));
   /* For -M, add the file to the dependencies on its first inclusion.  */
   if (CPP_OPTION (pfile, print_deps) > deps_sysp && !inc->include_count)

Alexandre Oliva   Enjoy Guarana', see
Red Hat GCC Developer                  aoliva@{,}
CS PhD student at IC-Unicamp        oliva@{,}
Free Software Evangelist    *Please* write to mailing lists, not to me

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