| |||
| Home > C and C++ Compilers > Command syntax > Setting preprocessor options | |||
The following command-line options control aspects of the preprocessor. (See Pragmas for descriptions of other preprocessor options that can be set by pragmas.)
-EThis option executes only the preprocessor phase of the compiler. By default, output from the preprocessor is sent to the standard output stream and can be redirected to a file using standard MS-DOS notation. For example:
compiler-name-Esource.c > raw.c
You can also use the -o option to specify
a file for the preprocessed output. By default, comments are stripped
from the output. The preprocessor accepts source files with any
extension (for example, .o, .s, and .txt).
See also the -C option.
-CThis option retains comments in preprocessor output
when used in conjunction with -E. This option differs
from the -c (lowercase) option that suppresses
the link step. See Specifying output format for
a description of the -c option.
-D, symbol=valueThis option defines as
a preprocessor macro. This has the same effect as the text symbol#define at the head of the source file. You can
repeat this option.symbol
value
If you use a quoted string value, for example -DFOO_VALUE="FOO_VALUE", you
must delimit the quotes as follows:
from
the command line, use -DFOO_VALUE=\"FOO_VALUE\"
in a via file, use ’-DFOO_VALUE="FOO_VALUE"’ or -DFOO_VALUE=’"FOO_VALUE"’.
-DsymbolThis option defines as
a preprocessor macro. This has the same effect as the text symbol#define at
the head of the source file. You can repeat this option. The default
value of symbol is 1. symbol
-MThis option executes only the preprocessor phase
of the compiler, as with -E. This option produces
a list of makefile dependency lines suitable for use by a make utility.
By default, output is on the standard output stream. You can redirect
output to a file by using standard MS-DOS notation. For example:
compiler-name-Msource.c >> Makefile
If you specify the -o option,
the dependency lines generated on standard output refer to filenamefilename.o,
not to source.o. However, no object file is
produced with the combination of -M -o .filename
-UsymbolThis option undefines .
This has the same effect as the text symbol#undef at
the head of the source file. You can repeat this option.symbol