Quantcast
Channel: Intel® C++ Compiler
Viewing all articles
Browse latest Browse all 1616

Regression: Incorrect Recursive Handling of ##__VA_ARGS__ After Passing Non-Argument in 16.0 Update 2

$
0
0

Hi,

Code that compiled in 16.0 Update 1 no longer compiles after upgrading to Update 2. Here is a simple test case:

#define RECURS(ARG0,...)\
	recurs(ARG0,##__VA_ARGS__)
#define FUNCS_OKAY(ARG0,...)\
	direct(ARG0,    ##__VA_ARGS__)\
	RECURS(ARG0,    ##__VA_ARGS__)
#define FUNCS_BROKEN(ARG0,...)\
	direct(ARG0, 7, ##__VA_ARGS__)\
	RECURS(ARG0, 7, ##__VA_ARGS__)

FUNCS_OKAY("arg0");
FUNCS_OKAY("arg0","args");

FUNCS_BROKEN("arg0");
FUNCS_BROKEN("arg0","args");

Intel 16.0 Update 2 produces (preprocess only, use "-EP -P"):

direct("arg0" ) recurs("arg0" );
direct("arg0","args") recurs("arg0","args");

direct("arg0", 7 ) recurs("arg0",7,);
direct("arg0", 7,"args") recurs("arg0",7,"args");

Notice that the comma was (erroneously) not elided after the "7" in the broken case (line 4). However, e.g. GCC 5.3.0 produces (use "-E"):

direct("arg0") recurs("arg0");
direct("arg0","args") recurs("arg0","args");

direct("arg0", 7) recurs("arg0", 7);
direct("arg0", 7,"args") recurs("arg0", 7,"args");

Thanks,
Ian


Viewing all articles
Browse latest Browse all 1616

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>