#include <stdio.h> int funcfunc2(int x) { return x+1; } int func1(int x) { return x+2; } int main() { int x = 0; int y = HASH(x); printf("x=%d\n", y); return 0; } I wrote the above code and I compiled with : gcc -O0 -DHASH=func1 -o test test.c and gcc -O0 -DHASH=func2 -o test test.c
And I got output 1 and 2. I think the important thing to notice is that I have not #defined HASH anywhere in the code.