Preprocesses the C or C++ source files named in the compiler invocation and creates an output preprocessed source file, file_name.i for each input source file file_name.c, file_name.C, or file_name.cpp. The default is to compile and link-edit C or C++ source files to produce an executable file.


Read syntax diagramSkip visual syntax diagram>>- -P---------------------------------------------------------><


The -P option calls the preprocessor directly.

The -P option retains all white space including line-feed characters, with the following exceptions:

#line directives are not issued.

The -P option cannot accept a preprocessed source file, such as file_name.i as input. The compiler will issue an error message.

Source files with unrecognized filename suffixes are treated and preprocessed as C files, and no error message is generated.

In extended mode, the preprocessor interprets the backslash character when it is followed by a new-line character as line-continuation in:

Line continuations elsewhere are processed in ANSI mode only.

The -P option is overridden by the -E option. The -P option overrides the -c, -o, and -qsyntaxonly option. The -C option may used in conjunction with both the -E and -P options.

Related information