"Mohamed Shafi" <[EMAIL PROTECTED]> writes:

> I am building a GCC Compiler. I have some ifdef checks in the compiler
> source code. In case i define a symbolic literal in command line while
> compiling a sample program, I want that set of statements to be
> invoked after ifdef checks.
> 
> e.g.
> GCC Source:
> #ifdef SHAFI_DEBUG
> printf("\n Shafi Debugging!!\n");
> #endif
> 
> compiling 1.c:
> gcc -DSHAFI_DEBUG 1.c
> 
> Is there any way to do this ?

You need to add a new option to the compiler.

If you think about how the preprocessor works, you will see that your
suggestion of using -D can not possibly work.

Ian

Reply via email to