This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
[PATCH] Fix -traditional stringify in cpp
- To: zack at wolery dot cumb dot org, gcc-patches at gcc dot gnu dot org
- Subject: [PATCH] Fix -traditional stringify in cpp
- From: Jakub Jelinek <jakub at redhat dot com>
- Date: Tue, 2 May 2000 17:49:06 +0200
- Reply-To: Jakub Jelinek <jakub at redhat dot com>
Hi!
Current CVS cpp crashes when trying to stringify -traditional(ly).
Fix and testsuite attached.
Found in XF4.0 cf stuff for Imake.
2000-05-02 Jakub Jelinek <jakub@redhat.com>
* cpphash.c (trad_stringify): Adjust p after stringification as
well.
* gcc.dg/cpp-tradstringify.c: New test.
--- gcc/cpphash.c.jj Tue May 2 09:32:04 2000
+++ gcc/cpphash.c Tue May 2 17:12:58 2000
@@ -450,6 +450,7 @@ trad_stringify (pfile, base, len, argc,
argv[i].rest_arg);
last = CPP_WRITTEN (pfile);
base = p + argv[i].len;
+ p = base;
goto proceed;
}
p++;
--- gcc/testsuite/gcc.dg/cpp-tradstringify.c.jj Tue May 2 17:20:41 2000
+++ gcc/testsuite/gcc.dg/cpp-tradstringify.c Tue May 2 17:18:21 2000
@@ -0,0 +1,4 @@
+/* Test whether traditional stringify works. */
+/* { dg-do preprocess } */
+/* { dg-options "-traditional" } */
+#define foo(a, b) c="a"; d="b";
Jakub