Results 1 to 3 of 3
Anyone know to ask g++ to show me source code post macro expansion? I have a #define that doesn't seem to be expanded as I expect.
Thanks!...
- 12-16-2009 #1Just Joined!
- Join Date
- Jan 2009
- Posts
- 2
Can g++ print macro expansion?
Anyone know to ask g++ to show me source code post macro expansion? I have a #define that doesn't seem to be expanded as I expect.
Thanks!
- 12-16-2009 #2
I think this will do it
g++ -E filename.cpp
Actually your probably better using
g++ -E filename.cpp>testfile
Then open testfile in an editorLast edited by gerard4143; 12-16-2009 at 10:03 PM.
Make mine Arch Linux
- 12-18-2009 #3Linux Guru
- Join Date
- Apr 2009
- Location
- I can be found either 40 miles west of Chicago, or in a galaxy far, far away.
- Posts
- 8,974
From the gcc man page:
Code:-E Stop after the preprocessing stage; do not run the compiler proper. The output is in the form of preprocessed source code, which is sent to the standard output. Input files which don’t require preprocessing are ignored.Sometimes, real fast is almost as good as real time.
Just remember, Semper Gumbi - always be flexible!


Reply With Quote