Option Type | Default Value | #pragma options | C | C++ |
-type | - | - | x | x |
Syntax
-E
Purpose
Runs the source files named in the compiler invocation through
the preprocessor. The -E option calls the
preprocessor directly as /usr/ibmcxx/exe/xlCcpp.
Notes
The -E and -P
options have different results. When the -E
option is specified, the compiler assumes that the input is a C
or C++ file and that the output will be recompiled or reprocessed
in some way. These assumptions are:
The -P option is used for general-purpose preprocessing. No assumptions are made concerning the input or the intended use of the output. This mode is intended for use with input files that are not written in C or C++. As such, all preprocessor-specific constructs are processed as described in the ANSI C standard. In this case, the continuation sequence is removed as described in the "Phases of Translation" of that standard. All non-preprocessor-specific text should be output as it appears.
Using -E causes #line directives to be generated to preserve the source coordinates of the tokens. Blank lines are stripped and replaced by compensating #line directives.
The line continuation sequence is removed and the source lines are concatenated with the -P option. With the -E option, the tokens are output on separate lines in order to preserve the source coordinates. The continuation sequence may be removed in this case.
The -E option overrides the -P, -o, and -qsyntaxonly options, and accepts any file name.
If used with the -M option, -E will work only for files with a .C (C++ source files), .c (C source files), or a .i (preprocessed source files) filename suffix. Source files with unrecognized filename suffixes are treated and preprocessed as C files, and no error message is generated.
Comments are replaced in the preprocessed output by a single space character. New lines and #line directives are issued for comments that span multiple source lines, and when -C is not specified. Comments within a macro function argument are deleted.
The default is to preprocess, compile, and link-edit source files to produce an executable file.
Example
To compile myprogram.c and send the preprocessed source to
standard output, enter:
xlC myprogram.c -E
If myprogram.c has a code fragment such as:
#define SUM(x,y) (x + y) ; int a ; #define mm 1 ; /* This is a comment in a preprocessor directive */ int b ; /* This is another comment across two lines */ int c ; /* Another comment */ c = SUM(a, /* Comment in a macro function argument*/ b) ;
the output will be:
#line 2 "myprogram.c" int a; #line 5 int b; int c; c = (a + b);
List of Compiler Options and Their
Defaults
Options that Specify Compiler Output