Created
January 18, 2020 20:28
-
-
Save ramajd/2630550eec8041deab7863f0273d424b to your computer and use it in GitHub Desktop.
macro argument string representation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stdio.h> | |
#define WARN_IF(EXPR) \ | |
if (EXPR) { \ | |
fprintf(stderr, "Warning: " #EXPR "\n"); \ | |
} | |
int main() { | |
int x = 1; | |
WARN_IF(x == 1); | |
return 0; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment