Chapter Contents |
Previous |
Next |
Compiler Options |
Preprocessor Symbols |
The compiler creates preprocessor symbols for a number of compiler options. The compiler assigns the preprocessor symbol's value to correspond to each option's state. Preprocessor Symbols lists the options and symbols, along with their corresponding values that the preprocessor creates.
The compiler assigns to the
_O_SNAME
symbol the
value
of the
sname
option, surrounded by quotes. For example,
specifying the
sname
option as MYPROG is equivalent to the following
preprocessor definition:
#define _O_SNAME "MYPROG"
If the
sname
option has not been specified,
the value assigned to
_O_SNAME
is "".
The
_O_ZAPSPACE
preprocessor symbol is
assigned the value of the
zapspace
option. If the
zapspace
option has not been specified,
_O_ZAPSPACE
is assigned
a value of 1.
The
_O_ZAPMIN
preprocessor symbol is assigned
the value of the
zapmin
option. If the
zapmin
option has not been
specified,
_O_ZAPMIN
is assigned a value of 1.
The #pragma options statement |
The
#pragma options
statement specifies
compiler options within program source code. More than one
#pragma
options
statement can be used in a source file. The format of the
#pragma options
statement is as follows:
#pragma options copts(option-1,option-2(n))
where option-1 and option-2 are compiler options, and n is the value that an option takes.
For example, you can specify the
bitfield
compiler option in the following manner:
#pragma options copts(bitfield(2))
where
2
is the value of the
bitfield
option.
Separate multiple options with commas or blanks. Both of the following examples are correct:
#pragma options copts (bitfield(2),pagesize(60),dollars)
#pragma options copts (bitfield(2) pagesize(60)
dollars)
The following options can be specified in a
#pragma
options
statement:
There are two other uses of the
#pragma
options
statement:
#pragma options push copts
statement pushes the current setting of compiler options to the top of the
stack.
#pragma options pop copts
statement returns the compiler options to their values at the time of the
last
push
statement.
The following example suppresses the source listing and then returns it to its previous state:
#pragma options push copts #pragma options copts(nosource) C statements #pragma options pop copts
The
pragma options push copts
statement
saves the current value of the options.
#pragma options copts (nosource)
temporarily suppresses the source listing. The
nosource
option remains in effect until the
#pragma options pop copts
statement appears in the program. The
#pragma options pop copts
statement returns the source listing (and all other options) to their states
preceding the
push
statement. If the source listing was suppressed
before the
push
statement, it will continue to be suppressed.
Chapter Contents |
Previous |
Next |
Top of Page |
Copyright © 2001 by SAS Institute Inc., Cary, NC, USA. All rights reserved.