You can use the -A, -D, and -U options as equivalents to preprocessing directives:
Use the -A option to make an assertion. Syntax: -Aname[(value)].
Argument | Description |
---|---|
name | Indicates an identifier for the assertion |
value | Indicates a value for the assertion. If a value is specified, it should be quoted, along with the parentheses delimiting it. |
For example, to make an assertion for the identifier fruit with the associated values orange and banana use the following command:
prompt>icpc -A"fruit(orange,banana)" prog1.cpp
Use the -D option to define a macro. Syntax: -Dname[=value].
Argument | Description |
---|---|
name | The name of the macro to define. |
value | Indicates a value to be substituted for name. If you do not enter a value, name is set to 1. The value should be quoted if it contains non-alphanumerics. |
For example, to define a macro called SIZE with the value 100 use the following command:
prompt>icpc -DSIZE=100 prog1.cpp
The -D option can also be used to define functions. For example:
prompt>icpc -D"f(x)=x" prog1.cpp
Use the -U option to remove (undefine) a pre-defined macro. Syntax: -Uname.
Argument | Description |
---|---|
name | The name of the macro to undefine. |
Note
If you use -D and -U in the same compilation, the compiler processes the -D option before -U, rather than processing them in the order they appear on the command line.