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]
Other format: [Raw text]

Re: [PATCH] Fix c/16999, #ident is outputted wrong from preprocessor



On Oct 8, 2004, at 1:32 PM, Zack Weinberg wrote:


Andrew Pinski <pinskia@physics.uc.edu> writes:

This patch fixes the problem as the string is already quoted when we go
out to print the string.


OK for 3.4 and the mainline? Bootstrapped and tested on powerpc-darwin.

OK. Please also add something to the test suite (suggest using dg-do "preprocess" and dg-final to scan for an appropriate directive in the preprocessed output).

This is what I added to the testsuite:
The line is not wrapped, it is my mailer being messed up (and I don't
know how to fix it).
Index: gcc.dg/cpp/ident-1.c
===================================================================
RCS file: gcc.dg/cpp/ident-1.c
diff -N gcc.dg/cpp/ident-1.c
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ gcc.dg/cpp/ident-1.c 8 Oct 2004 18:33:03 -0000
@@ -0,0 +1,7 @@
+/* { dg-do preprocess } */
+
+/* Based on PR 16999 */
+
+#ident "this is an ident"
+
+/* { dg-final { scan-file "ident-1.i" "(^|\\n)#ident \"this is an ident\"($|\\n)" } } */


Thanks,
Andrew Pinski


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