-P

Category

Output control

Pragma equivalent

None.

Purpose

Preprocesses the source files named in the compiler invocation, without compiling, and creates an output preprocessed file for each input file.

The preprocessed output file has the same name as the input file, with an .i suffix.

Syntax

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

Defaults

By default, source files are preprocessed, compiled, and linked to produce an executable file.

Usage

The -P option accepts any file name, except those with an .i suffix. Otherwise, source files with unrecognized file name suffixes are treated and preprocessed as C files, and no error message is generated.

Unless -qppline is specified, #line directives are not generated.

Line continuation sequences are removed and the source lines are concatenated.

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

The -P option is overridden by the -E option. The -P option overrides the -c, -o, and -qsyntaxonly option.

Predefined macros

None.

Related information