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* OS and Mac OS* X)
/warn:declarations
or /4Yd (Windows* OS)

NODECLARE  

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

DEFINE symbol  

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

FIXEDFORMLINESIZE:option    

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

FREEFORM  

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

NOFREEFORM

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

INTEGER:option

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

OBJCOMMENT

/libdir:user (Windows OS)

OPTIMIZE [ : n ]

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

NOOPTIMIZE

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

PACK:option

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

REAL:option

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

STRICT

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

NOSTRICT

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

Note

For Windows OS, 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.