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: "joseph at codesourcery dot com" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 19 Feb 2007 22:20:28 -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 #3 from joseph at codesourcery dot com 2007-02-19 22:20 -------
Subject: Re: [4.1/4.2/4.3 Regression] Internal
compiler error when using "x##,##__VA_ARGS__" in macro
The order of evaluation of ## operators is unspecified.
If the left ## is evaluated first, it tries to concatenate "1" with ",",
yielding undefined behavior (for some time GCC has diagnosed such attempts
at concatenation yielding invalid preprocessing tokens). If the right ##
is evaluated first, the GNU extension for concatenation of "," with empty
__VA_ARGS__ is engaged; this presumably should leave a placemarker token,
whose concatenation with "1" yields "1".
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=30805