#include <stdio.h>
#define DEBUG
#ifdef DEBUG
#define MAGIC 5
#endif
int main(void){
printf("\n magic is %d",MAGIC);
return 0;
}
Now i want to undef DEBUG so this program should give compilation error
gcc test.c -U DEBUG
But it does not give any error and works fine.
It means -U
does not work.
so how can I undef any name at compile time in gcc?