This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Dependence tracking broke implicit extern "C"
- To: gcc-patches at gcc dot gnu dot org
- Subject: Dependence tracking broke implicit extern "C"
- From: Alexandre Oliva <aoliva at redhat dot com>
- Date: 08 Mar 2001 16:43:48 -0300
- Organization: GCC Team, Red Hat
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
mangled.
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 <aoliva@redhat.com>
* cppfiles.c (stack_include_file): Use MAX of sysp.
Index: gcc/cppfiles.c
===================================================================
RCS file: /cvs/gcc/egcs/gcc/cppfiles.c,v
retrieving revision 1.101.4.3
diff -u -p -r1.101.4.3 cppfiles.c
--- gcc/cppfiles.c 2001/02/28 22:46:34 1.101.4.3
+++ 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 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 *Please* write to mailing lists, not to me