Preprocessor Options

The following options are accepted by the preprocessor:

-C

-C

Using the -Coption prevents the preprocessor from stripping comments. See the description of cpp in the cpp(1) manpage for details.

-dM

-dM

When -dMis present, instead of normal preprocessor output the compiler lists the #define directives it encounters as it preprocesses the file, thus providing a list of all macros that are in effect at the start of the compilation. The -dMoption requires that -Por -Ealso be specified.

A common use of this option is to determine the compiler's predefined macros. For example:

touch foo.c ; cc -E -dM foo.c

-Dname

-Dname[=def]

name is the symbol name that is defined for the preprocessor.

def is the definition of the symbol name (name).

The -Dnameoption defines a symbol name (name) to the preprocessor, as if defined by the preprocessing directive#define.

If no definition (def) is given, the name is defined as 1.

NOTE: __ia64 and __HP_aCC are defined automatically.

Example:

The following example defines the preprocessor symbol DEBUGFLAG and gives it the value 1.

aCC -DDEBUGFLAG file.C

The following program uses this symbol:

#include <iostream.h> int main(){

int i, j; #ifdef DEBUGFLAG int call_count=0; #endif

/* ... */

}

-E

-E

Using the -Eoption runs only the preprocessor on the named C++ files and sends the result to standard output (stdout).

An exception to this rule is when-Eis used with +Make[d] option, the only output is the make dependency information. Unlike the -Poption, the output of -Econtains #line entries indicating the original file and line numbers.

Redirecting Output From This Option

Use the -.suffixoption to redirect the output of this option.

72 Command-Line Options