Search notes:

cl /P /E /EP (Preprocess only)

The Visual Compiler options /P, /E and /PE preprocesses a source file only (without compling it into an object file).
This can be demonstrated with the following simple source file (which is neither valid C nor C++ code):
Start
#define NUM 42
The number is NUM
#ifdef NUM
It is defined
#else
It is not defined
#endif
The end
Github repository about-cl, path: /options/E-P-EP/file.c

/P to preprocess into a file

cl /P file.c creates file.i with the following content:
#line 1 "file.c"
Start

The number is 42

It is defined


#line 9 "file.c"
The end

/E to preprocess to stdout

cl /E file.c prints the (same) preprocessed result to stdout.

/EP to omit the line directives

cl /EP file.c also writes the preprocessed result to stdout and it also removes the #line directives:
Start

The number is 42

It is defined



The end

See also

The equivalent gcc options -E and -P.

Index