-P

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 but with a .i suffix.

Note: This option is not equivalent to the GCC option -P .

Syntax

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

Defaults

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

Usage

Source files with unrecognized file name suffixes are preprocessed as C files except those with a .i suffix.

#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:

  • All comments are reduced to a single space (unless -C is specified).
  • Line feeds at the end of preprocessing directives are not retained.
  • White space surrounding arguments to function-style macros is not retained.

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

Predefined macros

None.



Voice your opinion on getting help information Ask IBM compiler experts a technical question in the IBM XL compilers forum Reach out to us