This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Fix PR preprocessor/4890
- From: Neil Booth <neil at daikokuya dot co dot uk>
- To: gcc-patches at gcc dot gnu dot org
- Cc: Mark Mitchell <mark at codesourcery dot com>, gsicherm at elity dot com,Christian Ehrhardt <ehrhardt at mathematik dot uni-ulm dot de>
- Date: Fri, 8 Nov 2002 23:11:09 +0000
- Subject: Fix PR preprocessor/4890
Thanks to Christian Ehrhardt for investigating this. He noticed it
was not a C compiler issue, I noticed his message, and it was fairly
easy to locate and fix.
The bug is in that POS called tradcpp0. I'm still rejoicing I put it
out of its misery in 3.3. 3.3 doesn't have this bug in its integrated
traditional preprocessor.
Mark, can I apply this to 3.2? It's truly harmless, but is a 2.95
regression.
Neil.
* tradcpp.c (output_line_command): When leaving a file,
system_include_depth has not yet been decremented.
Index: tradcpp.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/Attic/tradcpp.c,v
retrieving revision 1.47.2.2
diff -u -p -r1.47.2.2 tradcpp.c
--- tradcpp.c 22 May 2002 05:58:48 -0000 1.47.2.2
+++ tradcpp.c 8 Nov 2002 23:06:11 -0000
@@ -4104,7 +4104,7 @@ output_line_command (ip, op, conditional
sprintf (line_cmd_buf, "# %d \"%s\"", ip->lineno, ip->fname);
if (file_change != same_file)
strcat (line_cmd_buf, file_change == enter_file ? " 1" : " 2");
- if (system_include_depth > 0)
+ if (system_include_depth > (file_change == leave_file))
strcat (line_cmd_buf, " 3");
len = strlen (line_cmd_buf);
line_cmd_buf[len++] = '\n';