[Bug preprocessor/30805] [4.1/4.2/4.3 Regression] Internal compiler error when using "x##,##__VA_ARGS__" in macro
bonzini at gnu dot org
gcc-bugzilla@gcc.gnu.org
Mon Apr 16 19:10:00 GMT 2007
------- 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
More information about the Gcc-bugs
mailing list