Last active
October 2, 2015 11:50
-
-
Save krono/210c2ccbd69e74097f61 to your computer and use it in GitHub Desktop.
ID shadowing?
This file contains hidden or 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
struct {int foo;} snarfu; | |
/* | |
*/ | |
#define WRAP(x) x | |
/* | |
*/ | |
snarfu; | |
snarfu(); | |
WRAP(snarfu); | |
WRAP(snarfu()); | |
/* | |
*/ | |
#define snarfu() snarfu | |
/* | |
*/ | |
snarfu; | |
snarfu(); | |
WRAP(snarfu); | |
WRAP(snarfu()); | |
/* | |
*/ | |
#undef snarfu | |
#define snarfu() WRAP(snarfu) | |
/* | |
*/ | |
snarfu; | |
snarfu(); | |
WRAP(snarfu); | |
WRAP(snarfu()); | |
/********/ | |
((WRAP(snarfu).foo)) <= (WRAP(x) + y); | |
#define mytest(x) ((x)||error(#x "foo")) | |
mytest(((WRAP(snarfu).foo)) <= (WRAP(x) + y)); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment