Compiler Directives Related to Options

Some compiler directives and compiler options have the same effect, as shown in the table below. However, compiler directives can be turned on and off throughout a program, while compiler options remain in effect for the whole compilation unless overridden by a compiler directive.

Compiler directives and equivalent command-line compiler options are:

Compiler Directive Equivalent Command-Line Compiler Option

DECLARE  

-warn declarations (Linux* and Mac OS*)
/warn:declarations
or /4Yd (Windows*)

NODECLARE  

-warn nodeclarations (Linux and Mac OS)
/warn:nodeclarations
or /4Nd (Windows)

DEFINE symbol  

-Dname (Linux and Mac OS)
/define:symbol or /Dname (Windows)

FIXEDFORMLINESIZE:option    

-extend_source [option] (Linux and Mac OS)
/extend_source[:n] or /4Ln (Windows)

FREEFORM  

-free or -nofixed (Linux and Mac OS)
/free
or /nofixed or /4Yf (Windows)

NOFREEFORM

-nofree or -fixed (Linux and Mac OS)
/nofree
or /fixed or /4Nf (Windows)

INTEGER:option

-integer_size option (Linux and Mac OS)
/integer_size:
option or /4Ioption (Windows)

OBJCOMMENT

/libdir:user (Windows)

OPTIMIZE [ : n ]

-O (Linux and Mac OS) or /O (Windows)
n is 0, 1, 2, or 3 for opt levels -O0 through -O3. If n is omitted, default is 2.

NOOPTIMIZE

-O0 (Linux and Mac OS) or /Od (Windows)

PACK:option

-align [option] (Linux and Mac OS)
/align[:
n] or /Zpn (Windows)

REAL:option

-real_size option (Linux and Mac OS)
/real_size:
option or /4Roption (Windows)

STRICT

-warn stderrors with -stand (Linux and Mac OS)
/warn:stderrors with /stand:f90
or /4Ys (Windows)

NOSTRICT

-warn nostderrors (Linux and Mac OS)
/warn:nostderrors
or /4Ns (Windows)

Note

For Windows*, the compiler directive names above are specified using the prefix !DEC$ followed by a space;  for example: !DEC$ NOSTRICT. The prefix !DEC$ works for both fixed-form and free-form source. You can also use these alternative prefixes for fixed-form source only: cDEC$, CDEC$,*DEC$, cDIR$, CDIR$, *DIR$, and !MS$.

For more information on compiler directives, see Directive Enhanced Compilation.