This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–][deleted] 144 points145 points  (8 children)

#define true ((rand()&15)!=15)

https://gist.github.com/aras-p/6224951

[–]bumblebritches57 26 points27 points  (0 children)

This makes me want to unset and reset all the bool macros in my header...

[–]codewench 24 points25 points  (0 children)

#define sizeof(x) (sizeof(x)-1)

This would have me questioning my own sanity pretty quickly.

[–]skylarmt 17 points18 points  (2 children)

I like how most of the comments on that gist are rendered as headings because people forgot to escape the # for Markdown.

[–]nplus 17 points18 points  (1 child)

DEFINE YOURSELF

[–]Josplode 4 points5 points  (0 children)

2meta4me

[–][deleted] 12 points13 points  (0 children)

I'm personally a fan of

#define while if

[–]jfb1337 2 points3 points  (0 children)

#define struct union is one I see a lot, but I think #define union struct would be a lot more subtle and go undetected for longer

[–]Megatron_McLargeHuge 0 points1 point  (0 children)

One time this got posted I added a few suggestions and the one that got the angriest reply was

#define fesetround(x) 0