How do I run the GCC preprocessor to get the code after macros like #define are expanded?

Viewed 32535

Is there an option that the GCC preprocessor could generate C source code and filter out irrelevant source code?

For example, a .c file has a #define switch to define for many different platforms. I'm only interested in one platform, and I want the C preprocessor to filter out unrelated code.

Does GCC support this?

3 Answers
Related