-E
Purpose
Preprocesses the source files named in the compiler invocation, without compiling.
Syntax
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 -fsyntax-only options. The combination of -E -o stores the preprocessed result in the file specified by -o.
Predefined macros
None.
Examples
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*/To compile
myprogram.c and send the preprocessed source to standard output,
enter:
ibm-clang myprogram.c -E
The output is:
int a ;
int b ;
int c ;
c = a + b ;
