Specify Batch Compiler Options in Your Program Source Files

To specify compiler options in your program source files, use the preprocessor directive:

#pragma options compiler_options

If you specify more than one compiler option, separate the options using a blank space. For example:

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

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=ansi halt=s spill=1024 source
/* The rest of the source follows ... */

Options specified before any code in your source program apply to your entire program source code. You can use other #pragma directives throughout your program to turn an option on for a selected block of source code. For example, you can request that parts of your source code be included in your compiler listing:

#pragma options source 
/*  Source code between the source and nosource #pragma
    options is included in the compiler listing                */
#pragma options nosource

Options specified in program source files override all other option settings.

These #pragma directives are listed in the detailed descriptions of the options to which they apply. For complete details on the various #pragma preprocessor directives, see the List of Pragma Preprocessor Directives.



Batch Compiler Options


Invoke the Batch Compiler
Specify Compiler Options on the Command Line
Specify Compiler Options in a Configuration File


Resolving Conflicting Compiler Options
List of Batch Compiler Options and Their Defaults