/E   (Preprocess to stdout)

HomeOverviewHow Do ICompiler Options

This option preprocesses C and C++ source files and copies the preprocessed file to the standard output device. The output is identical to the original source file, except that all preprocessor directives are carried out, macro expansions are performed, and comments are removed. You can use the /C option with /E to preserve comments in the preprocessed output.

Use the /E option when you want to resubmit the preprocessed listing for compilation. Unlike the /EP option, /E adds #line directives to the output. The #line directives are placed at the beginning and end of each included file and around lines removed by preprocessor directives that specify conditional compilation. The #line directives renumber the lines of the preprocessed file so that errors generated during later stages of processing refer to the line numbers of the original source file rather than to the preprocessed file. Use the /EP option to suppress #line directives.

The /E option suppresses compilation. It also suppresses the output files from the /FA, /Fa, and /Fm options.

Note   You cannot use precompiled headers with the /E option.

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

Example

The following command creates a preprocessed file from the source file ADD.C. It preserves comments and adds #line directives. The output is displayed:

CL /E /C ADD.C