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



--- Comment #4 from Evgeny Televitckiy <stelek at gmail dot com> 2013-04-04 
06:41:38 UTC ---

Ye, I thought it was something along those lines. Thanks for the clarification,

now I understand the reason why this paragraph appear in standard.

Yet, appealing to the end of your comment. I would expect ,##x construct to be

an exception, especially that it has a totally different meaning then

concatenating # or stringifying ##.

Clearly one would expect:

#define E3N(n, ar...) E3NI(_, ##ar, n, n, n)

#define E3NI(a0, a1, a2, a3, ...) a1, a2, a3



#define USE_E3_ARG_R(n, ar...) (E3N(n, ar))

#define USE_E3_ARG_W(n, ar...) (E3N(n, ##ar))



and used:

 USE_E3_ARG_R(5, USE_E3_ARG_R(6, 7));

 USE_E3_ARG_W(5, USE_E3_ARG_W(6, 7));



To produce the same result...



In addition I wanted to add that it is not some virtual problem. I actually

spent 3 hours of my life in that macro hell, trying to understand what went

wrong with that macro,

Reply via email to