Top "Variadic-macros" questions

Variadic macros are a feature of the C-preprocessor that permit a variable number of arguments to a macro.

Error when defining a stringising macro with __VA_ARGS__

I have been trying to implement a function macro in C that prepends "DEBUG: ", to the argument, and passes its …

c macros c-preprocessor variadic-macros stringification
MSVC++ variadic macro expansion

So I've got a macro that works nicely in GCC, but not in Microsoft's C++ Compiler. I'm hoping somebody might …

c++ visual-c++ c-preprocessor variadic-macros
Cleaning up C/C++ code reveals problems with variadic macros

We're doing some code cleanup, fixing signed/unsigned comparisons, running static analysis, etc, on the code base of C, C++, …

c++ c macros c99 variadic-macros
A #define in C with three dots

#define LOGI(...) ((void)__android_log_print(ANDROID_LOG_INFO, "native-activity", __VA_ARGS__)) #define LOGW(...) ((void)__android_log_print(ANDROID_LOG_…

c label c-preprocessor notation variadic-macros
Appending to __VA_ARGS__

I know I can do this: #define MACRO(api, ...) \ bool ret = api(123, ##__VA_ARGS__); This is just an example, it's …

c gcc c-preprocessor variadic-macros
'ISO C99 requires at least one argument for the "..." in a variadic macro' When specifically using c11 and -Wno-variadic-macros

I have a simple: #define log(text, ...) fprintf(stderr, "stuff before" text "stuff after", ## __VA_ARGS__); which is triggering: error: …

gcc macros variadic-macros