/P (Preprocess to a File)
| Overview | How Do I | Compiler Options
This option writes preprocessor output to a file with the same base name as the source file, but with the .I extension. It adds #line directives to the output file 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.
This option suppresses compilation; CL does not produce an .OBJ file, even if the /Fo option is specified. The /P option also suppresses production of the alternate output files created by the /FA, /Fa, or /Fm option.
The /P option is similar to the /E and /EP options. Using /EP with /P suppresses placement of #line directives in the output file.
The following table summarizes the actions of the /E, /EP, and /P options.
Option | Preprocessor output includes #line directives? |
Output sent to |
/E | Yes | stdout |
/P | Yes | .i file |
/EP | No | stdout |
/E /EP | No | stdout |
/P /EP | No | .i file |