This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
NO_IMPLICIT_EXTERN_C out of cppinit.c
- From: Zack Weinberg <zack at codesourcery dot com>
- To: gcc-patches at gcc dot gnu dot org
- Date: Fri, 31 May 2002 15:57:21 -0700
- Subject: NO_IMPLICIT_EXTERN_C out of cppinit.c
It is not necessary for NO_IMPLICIT_EXTERN_C to be handled in two
different places. Since I am trying to render cpplib independent of
target headers, I chose to leave the handler in c-lex.c instead of the
one in cppinit.c. (Technically, *both* of them are the wrong place;
it should be done way upstream, in cppdefault.c etc, but this patch
needs to happen anyway.)
The form of -E output on NO_IMPLICIT_EXTERN_C targets changes
slightly; they will now generate the "4" markers on system header
#-lines, as their IMPLICIT_EXTERN_C counterparts do. But those
markers will be ignored when the preprocessed source is read back in.
Bootstrapped i686-linux. I also verified that on a
NO_IMPLICIT_EXTERN_C target, system headers still don't get implicit
extern "C", and that on an IMPLICIT_EXTERN_C target they do. Applied.
zw
* cppinit.c (append_include_chain): Always pay attention to
cxx_aware when setting new->sysp. Remove ATTRIBUTE_UNUSED
marker on argument.
===================================================================
Index: cppinit.c
--- cppinit.c 29 May 2002 17:15:31 -0000 1.235
+++ cppinit.c 31 May 2002 22:54:02 -0000
@@ -207,7 +207,7 @@ append_include_chain (pfile, dir, path,
cpp_reader *pfile;
char *dir;
int path;
- int cxx_aware ATTRIBUTE_UNUSED;
+ int cxx_aware;
{
struct cpp_pending *pend = CPP_OPTION (pfile, pending);
struct search_path *new;
@@ -252,11 +252,7 @@ append_include_chain (pfile, dir, path,
include files since these two lists are really just a concatenation
of one "system" list. */
if (path == SYSTEM || path == AFTER)
-#ifdef NO_IMPLICIT_EXTERN_C
- new->sysp = 1;
-#else
new->sysp = cxx_aware ? 1 : 2;
-#endif
else
new->sysp = 0;
new->name_map = NULL;