How do I see a C/C++ source file after preprocessing in Visual Studio?

前端 未结 10 745
一个人的身影
一个人的身影 2020-11-22 05:44

Let\'s say I have a source file with many preprocessor directives. Is it possible to see how it looks after the preprocessor is done with it?

10条回答
  •  孤独总比滥情好
    2020-11-22 06:27

    CPIP is a new C/C++ preprocessor written in Python. If you want a detailed visual representation of a preprocessed file, give it a shot.

    CPIP is a C/C++ pre-processor implemented in Python. Most pre-processors regard pre-processing as a dirty job that just has to be done as soon as possible. This can make it very hard to track down subtle defects at the pre-processing stage as pre-processors throw away a lot of useful information in favor of getting the result as cheaply as possible.

    Few developers really understand pre-processing, to many it is an obscure bit of black magic. CPIP aims to improve that and by recording every detail of preprocessing so CPIP can can produce some wonderfully visual information about file dependencies, macro usage and so on.

    CPIP is not designed to be a replacement for cpp (or any other established pre-processor), instead CPIP regards clarity and understanding as more important than speed of processing.

提交回复
热议问题