Skip to content
Snippets Groups Projects
Commit 0208410e authored by Danny Auble's avatar Danny Auble
Browse files

x is past in as something like ("print %s", buf) that can not be compared

to NULL.

At least if you try the compiler gives this warning

warning: left-hand operand of comma expression has no effect [-Wunused-value]

In 13.12 this is treated as an error
parent 81664b22
No related branches found
No related tags found
No related merge requests found
...@@ -30,11 +30,7 @@ ...@@ -30,11 +30,7 @@
#if (1) #if (1)
#define PMI2U_printf(x...) do { \ #define PMI2U_printf(x...) do { \
char logstr[1024]; \ char logstr[1024]; \
if (NULL == x) { \ snprintf(logstr, 1024, x); \
snprintf(logstr, 1024, "N/A"); \
} else { \
snprintf(logstr, 1024, x); \
} \
fprintf(stderr, "[%s (%d): %s] %s\n", \ fprintf(stderr, "[%s (%d): %s] %s\n", \
__FILE__, __LINE__, __FUNCTION__, logstr); \ __FILE__, __LINE__, __FUNCTION__, logstr); \
} while (0) } while (0)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment