A zero-length __VA_ARGS__ would result in a trailing comma, which is a syntax error. GCC supports zero-length __VA_ARGS__ with an extension to eat the comma: , ## __VA_ARGS__.
But this is not standard and since CMakeLists.txt sets -Wall -Wextra -Wpedantic, we get a ton of spurious warnings when building with clang:
uvgRTP-master/include/uvgrtp/debug.hh:56:27: warning: token pasting of ',' and __VA_ARGS__ is a GNU extension [-Wgnu-zero-variadic-macro-arguments]
"", __func__, ##__VA_ARGS__)
^
So the function uvgrtp_debug can be implemented as a variadic function (which unlike variadic macros, do support zero-length va_list).
A zero-length
__VA_ARGS__
would result in a trailing comma, which is a syntax error. GCC supports zero-length__VA_ARGS__
with an extension to eat the comma:, ## __VA_ARGS__
.But this is not standard and since CMakeLists.txt sets
-Wall -Wextra -Wpedantic
, we get a ton of spurious warnings when building with clang:So the function uvgrtp_debug can be implemented as a variadic function (which unlike variadic macros, do support zero-length va_list).