-
Notifications
You must be signed in to change notification settings - Fork 16
Open
Description
I'm trying to use printf with empty parameters, like:
printf("Just a debug string")
Currently, I get a compiler error with the original code.
The solution is to change these lines:
PrintEx/src/lib/PrintExtension.h
Lines 202 to 203 in 7e13cfc
| #define sprintf(buff, str, ...) GString(buff).printf(str, __VA_ARGS__) | |
| #define xprintf(out, str, ...) PrintEx(out).PRINTF_ALIAS(str, __VA_ARGS__) |
PrintEx/src/lib/PrintExtension.h
Line 208 in 7e13cfc
| #define printf(format, ...) PRINTF_ALIAS(format, __VA_ARGS__) |
To:
#define sprintf(buff, str, ...) GString(buff).printf(str, ##__VA_ARGS__)
#define xprintf(out, str, ...) PrintEx(out).PRINTF_ALIAS(str, ##__VA_ARGS__)
#define printf(format, ...) PRINTF_ALIAS(format, ##__VA_ARGS__)
Note the leading ## in __VA_ARGS__
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels