Open GiovanniCmpaner opened 5 years ago
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: https://github.com/Chris--A/PrintEx/blob/7e13cfc1998920262e1f575def2c146ac8958523/src/lib/PrintExtension.h#L202-L203 https://github.com/Chris--A/PrintEx/blob/7e13cfc1998920262e1f575def2c146ac8958523/src/lib/PrintExtension.h#L208
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__
__VA_ARGS__
What is the status of this issue. Seems like something that should get fixed for sure.
I'm trying to use printf with empty parameters, like:
Currently, I get a compiler error with the original code.
The solution is to change these lines: https://github.com/Chris--A/PrintEx/blob/7e13cfc1998920262e1f575def2c146ac8958523/src/lib/PrintExtension.h#L202-L203 https://github.com/Chris--A/PrintEx/blob/7e13cfc1998920262e1f575def2c146ac8958523/src/lib/PrintExtension.h#L208
To:
Note the leading ## in
__VA_ARGS__