show C preprocessor output

I am having trouble with includes & macros written in C. I would like to see how the proprocessor code expands.


I am using xtool 2.x. It's old, so I'll take whatever generic help you may offer.


I would like the preprocessor/compiler to generate the preprocess output and continue with the complile.


Robert

Posted on Jul 8, 2012 11:39 AM

Reply
7 replies

Jul 9, 2012 6:05 PM in response to rccharles

Xcode is not going to create a new file in your project folder with the preprocessed output. Try selecting a .c file from the Groups and Files list before choosing Build > Preprocess. When I do this with a C++ file, I get preprocessed output where it says No Editor in your screenshot. I also get preprocessed output in the editor that is attached to the project window. If you don't see the editor, drag the separator at the bottom of the project window to show the editor.

Jul 10, 2012 9:13 AM in response to Mark Szymczyk

That worked! Thanks.


For what it is worth, I had to select the .c file in the middle of the screen.


Thanks for your presistance.



--------------------------------------------------------------


I found some open source code that I'm in the process of updating. First, I got to understand it.


I was getting errors on the macro generation which motivated me in asking the question. The macro output without Macro names that look like function names helps me sort out the code. This provides another angle on the code. ( I know do a global search. )

Another quaint thing is the code doesn't have any comments ... well it does have the open source declarations. Pointer use is rampant. The three part if in the middle of a print statement is a little surprising to me. cpp does a nice job of formating the print statement which I can follow.


And I rather code in python.


Robert

This thread has been closed by the system or the community team. You may vote for any posts you find helpful, or search the Community for additional answers.

show C preprocessor output

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple Account.