This is the mail archive of the gcc-bugs@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]

[Bug preprocessor/30805] [4.1/4.2/4.3 Regression] Internal compiler error when using "x##,##__VA_ARGS__" in macro



------- Comment #5 from bonzini at gnu dot org  2007-04-16 20:10 -------
What about a patch like this?

Index: macro.c
===================================================================
--- macro.c     (revision 123691)
+++ macro.c     (working copy)
@@ -499,9 +499,15 @@ paste_all_tokens (cpp_reader *pfile, con
        rhs = *FIRST (context).ptoken++;

       if (rhs->type == CPP_PADDING)
-       abort ();
+       {
+         /* In obscure cases where the GNU extension ,##__VA_ARGS__ is
+            used, we can get a CPP_PADDING token here.  Assert that we
+            can safely ignore it.  */
+         if (rhs->flags & PASTE_LEFT)
+           abort ();
+       }

-      if (!paste_tokens (pfile, &lhs, rhs))
+      else if (!paste_tokens (pfile, &lhs, rhs))
        break;
     }
   while (rhs->flags & PASTE_LEFT);


-- 

bonzini at gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |bonzini at gnu dot org


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=30805


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