We are running a survey to help us improve the experience for all of our members. If you see the survey appear, please take the time to tell us about your experience if you can.
Hi, has the C compiler/preprocessor the ability to translate "variadic macros" - Macros with a variable parameter list like in the Ansi C99 standard? If not, how can one implement a debug printf (variable parameter count) that is completely removed in the production code is? Description of GNU C: "A macro can be declared to accept a variable number of arguments much as a function can... Here is an example: #define eprintf(...) fprintf (stderr, __VA_ARGS__) This kind of macro is called variadic. When the macro is invoked, all the tokens in its argument list after the last named argument ... of tokens replaces the identifier __VA_ARGS__ in the macro body wherever it appears: eprintf ("%s:%d: ", input_file, lineno) ==> fprintf (stderr, "%s:%d: ", input_file, lineno)"
Search for "TRACE" - this was discussed recently.