Option Type | Default Value | #pragma options | C | C++ |
-flag | - | - | x | x |
Syntax
-Dname=definition | -Dname= | -Dname
Purpose
Defines the identifier name as in a #define
preprocessor directive. definition is an optional
definition or value assigned to name.
Notes
The identifier name can also be defined in your source
program using the #define preprocessor
directive.
-Dname= is equivalent to #define name.
-Dname is equivalent to #define name 1. (This is the default.)
To aid in program portability and standards compliance, the AIX Version 4 OPerating System provides several header files that define macro names you can set with the -D option. You can find most of these header files either in the /usr/include directory or in the /usr/include/sys directory. See "Header Files Overview" in the AIX Version 4 Files Reference for more information.
The configuration file uses the -D option to specify the following predefined macros:
To ensure that the correct macros for your source file are defined, use the -D option with the appropriate macro name. If your source file includes the /usr/include/sys/stat.h header file, you must compile with the option -D_POSIX_SOURCE to pick up the correct definitions for that file.
If your source file includes the /usr/include/standards.h header file, _ANSI_C_SOURCE, _XOPEN_SOURCE, and _POSIX_SOURCE are defined if you have not defined any of them.
The -Uname option has a higher precedence than the -Dname option.
Example
To specify
that all instances of the name COUNT be replaced by 100 in
myprogram.c, enter:
xlC myprogram.c -DCOUNT=100
This is equivalent to having #define COUNT 100 at the beginning of the source file.
List of Compiler Options and Their
Defaults
Options that Specify Preprocessor Options