This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug preprocessor/30805] [4.1/4.2/4.3 Regression] Internal compiler error when using "x##,##__VA_ARGS__" in macro
- From: "bonzini at gnu dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 16 Apr 2007 19:10:17 -0000
- Subject: [Bug preprocessor/30805] [4.1/4.2/4.3 Regression] Internal compiler error when using "x##,##__VA_ARGS__" in macro
- References: <bug-30805-14101@http.gcc.gnu.org/bugzilla/>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- 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