Added support for variadic macros (as in C99).
commite58af3c7766d5fa80e440f1de46242018ccbcce1
authorMihail Groza <unlupdestepa@gmail.com>
Mon, 6 Feb 2017 20:25:19 +0000 (6 20:25 +0000)
committerMihail Groza <unlupdestepa@gmail.com>
Mon, 6 Feb 2017 20:25:19 +0000 (6 20:25 +0000)
tree93c166650da55c9668d6aedb96d83508e2ab9497
parentef05c82bfa0c98d003d1ffa19aa31200c1e51e1e
Added support for variadic macros (as in C99).

This is inspired by the patch for bug #359894 in Debian (by "Bernhard R.
Link" <brlink@debian.org>) and the changes in its integration upstream
(Bill Pringlemeir <bpringlemeir@users.sourceforge.net>, July 8 2010).

Several changes are made to the original and upstream patches to fix
additional problems (the very unlikely case of ellipsis followed by
parameters caused wrong reads), avoid useless operations. The upstream
fix also tried to implement a warning on standard C99 variadic
parameters, while allowing GNU extension variadic parameters without any
warning -- reverted to the correct warning logic.

Also, a related routine that does almost the same thing (but uses
location instead of PFILE) also needed the same update in order to keep
consistency.

Added test to check the added functionality.
src/cpplib.c
test/Makefile
test/variadicmacro.c [new file with mode: 0644]
test/variadicmacro.expect [new file with mode: 0644]