I am a bit rusty, but isn't it always better to individually parenthesize macro variables in the expression?
#define CHECK(X, Y) \
do { printf("Performing Assertion\n"); assert((X - Y) != 0); \
printf("Assertion passed\n"); } while (0)
Here, assert((X - Y) != 0) should be assert(((X) - (Y)) != 0)It's OK when you are doing subtraction, but if you were doing something like division or multiplication, you could screw with the order of operations if you don't do this.