Chapter Contents

Previous

Next
Compiler Options

Preprocessor Options Processing


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.

Preprocessor Symbols
Option Symbol Value
armode
_O_ARMODE
1
noarmode
_O_ARMODE
0
at _O_AT 1
noat _O_AT 0
bitfield(1) _O_BITFIELD 1
bitfield(2) _O_BITFIELD 2
bitfield(4) _O_BITFIELD 4
nobitfield _O_BITFIELD 0
bytealign _O_BYTEALIGN 1
nobytealign _O_BYTEALIGN 0
comnest _O_COMNEST 1
nocomnest _O_COMNEST 0
cxx _O_CXX 1
nocxx _O_CXX 0
dbhook _O_DBHOOK 1
nodbhook _O_DBHOOK 0
debug _O_DEBUG 1
nodebug _O_DEBUG 0
dollars _O_DOLLARS 1
nodollars _O_DOLLARS 0
indep _O_INDEP 1
noindep _O_INDEP 0
inline _O_INLINE 1
noinline _O_INLINE 0
japan _O_JAPAN 1
nojapan _O_JAPAN 0
pflocal _O_PFLOCAL 1
nopflocal _O_PFLOCAL 0
posix _O_POSIX 1
noposix _O_POSIX 0
ppix _O_PPIX 1
noppix _O_PPIX 0
rent _O_RENT 1
norent _O_RENT 0
rentext _O_RENTEXT 1
norentext _O_RENTEXT 0
sname _O_SNAME value of option
stringdup _O_STRINGDUP 1
nostringdup _O_STRINGDUP 0
trigraphs _O_TRIGRAPHS 1
vstring _O_VSTRING 1
novstring _O_VSTRING 0
zapmin _O_ZAPMIN value of option
zapspace _O_ZAPSPACE value of option

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:

The following options can be specified in a #pragma options statement:

at hlist ppix
bitfield hmulti redef
comnest hxref reqproto
ctsup ilist source
cwsup imulti strict
dbgmacro ixref suppress
dollars maclist trigraphs
dynamndef mention undef
enforce mlist warn
exclude pagesize xref

Only these options and their negations can be specified, and they must be specified entirely in lowercase and unabbreviated.

There are two other uses of the #pragma options 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.