Skip to content

Instantly share code, notes, and snippets.

@mwotton
Created August 3, 2013 23:45
Show Gist options
  • Star 21 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mwotton/6148426 to your computer and use it in GitHub Desktop.
Save mwotton/6148426 to your computer and use it in GitHub Desktop.
whee, i made their pointless C compile!
typedef struct {
int girlfriend;
} holder;
typedef struct {
holder a;
} toplevel;
typedef struct {
int this;
} yoda;
int main() {
holder holder = { 2 };
yoda understand = { 2 };
toplevel get = {holder};
int you = 2;
/* whee, i made this stupid code work! */
if (you == understand.this) {
get.a.girlfriend;
}
return 0;
}
@rvagg
Copy link

rvagg commented Aug 6, 2013

yes, I think @pranavrc wins this thread with that one, macro-to-the-max!

@seler
Copy link

seler commented Dec 21, 2015

Instead of trying to defend original code I'll propose how it should actually look to make sense:

if (you.understand(this)){
    you.get_a_girlfriend();
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment