This is the mail archive of the gcc-help@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Preprocess, but do not expand macros?


> > Is there a simple way for me to tell gcc/cpp to run
> > the preprocessor, but do nothing more than remove the
> > code which would not be present after if/ifdef/ifndef?
> 
> Well the macros, namely "define" statements, are part
> of the preprocessor directives. [...]

To clarify, I would want the #define directives to be
processed, since otherwise the if/ifdef/ifndef might
not be meaningfully evaluated.  I simply do not want
the symbols defined by the #defines to be expanded.

before:
    #define PI 3.14
    #ifdef PI
        a = PI
    #endif

after:
        a = PI

instead of:
        a = 3.14


Larry


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]