#pragma options

Category

Language element control

Purpose

Specifies compiler options in your source program.

Syntax

Read syntax diagramSkip visual syntax diagram
                           .--------------------------------------.   
                           V                                      |   
>>-#--pragma--+-option--+----+-option_keyword-------------------+-+-><
              '-options-'    |                    .-;---------. |     
                             |                    | .-,-----. | |     
                             |                    V V       | | |     
                             '-option_keyword--=------value-+-+-'     

Parameters

The settings in the table below are valid options for #pragma options. For more information, see the pages of the equivalent compiler option.

Valid settings for #pragma options option_keyword Compiler option equivalent
align=option -qalign
[no]attr

attr=full

-qattr
chars=option -qchars
[no]check -qcheck
[no]compact -qcompact
[no]dbcs -qmbcs, -qdbcs
[no]dbxextra -qdbxextra
[no]digraph -qdigraph
[no]dollar -qdollar
enum=option -qenum
[no]extchk -qextchk
flag=option -qflag
float=[no]option -qfloat
[no]flttrap -qflttrap
[no]fullpath -qfullpath
halt -qhalt
[no]idirfirst -qidirfirst
[no]ignerrno -qignerrno
ignprag=option -qignprag
[no]info=option -qinfo
initauto=value -qinitauto
[no]inlglue -qinlglue
isolated_call=names -qisolated_call
langlvl -qlanglvl
[no]ldbl128 -qldbl128, -qlongdouble
[no]libansi -qlibansi
[no]list -qlist
[no]longlong -qlonglong
[no]macpstr -qmacpstr
[no]maxmem=number -qmaxmem
[no]mbcs -qmbcs, -qdbcs
[no]optimize=number -O, -qoptimize
proclocal, procimported, procunknown -qprocimported, -qproclocal, -qprocunknown
[no]proto -qproto
[no]ro -qro
[no]roconst -qroconst
[no]showinc -qshowinc
[no]source -qsource
spill=number -qspill
[no]srcmsg -qsrcmsg
[no]stdinc -qstdinc
[no]strict -qstrict
tbtable=option -qtbtable
tune=option -qtune
[no]unroll=[yes/no/auto/n] -qunroll
[no]upconv -qupconv
[no]xref -qxref

Usage

Most #pragma options directives must come before any statements in your source program; only comments, blank lines, and other pragma specifications can precede them. For example, the first few lines of your program can be a comment followed by the #pragma options directive:
/* The following is an example of a #pragma options directive: */

#pragma options langlvl=stdc89 halt=s spill=1024 source

/* The rest of the source follows ... */
To specify more than one compiler option with the #pragma options directive, separate the options using a blank space. For example:
#pragma options langlvl=stdc89 halt=s spill=1024 source