-E
Category
Pragma equivalent
None.
Purpose
Preprocesses the source files named in the compiler invocation, without compiling.
Defaults
By default, source files are preprocessed, compiled, and linked to produce an executable file.
Usage
Source files with unrecognized file name suffixes are treated and preprocessed as C files.
Unless -C is specified, 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.
The -E option overrides the -P and -fsyntax-only (-qsyntaxonly) options. The combination of -E -o stores the preprocessed result in the file specified by -o.
Predefined macros
None.
Examples
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,b) ; /* Comment in a macro function argument*/
the
output will be:
int a ;
int b ;
int c ;
c = a + b ;