/P (Create Preprocessor-Output File)

The /P option writes preprocessor output to a file with the same base name as the source file but with the .I extension. This option adds #line directives to the output file. They are placed at the beginning and end of each included file and around lines removed by preprocessor directives that specify conditional compilation.

The preprocessed listing file is identical to the original source file except that all preprocessor directives are carried out and macro expansions are performed. You usually use the /P option with the /C option (discussed on topic ), which preserves comments in the preprocessed output.

The /P option suppresses compilation; CL does not produce an object file or listing, even if you specify the /Fo or /Fm option on the CL command line.

The /P option is similar to both the /E and the /EP options, which are described earlier in this chapter. Use of /EP with /P suppresses placement of #line directives in the output file.

Example

CL /P MAIN.C

This example creates the preprocessed file MAIN.I from the source file MAIN.C.