This is the mail archive of the gcc-patches@gcc.gnu.org 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]

[PATCH] Fix -traditional stringify in cpp


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

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