Sun Studio 12: Fortran User's Guide

3.4.120 –xcheck=keyword

Generate special runtime checks and initializations.

The keyword must be one of the following:

keyword

Feature  

stkovf

Turn on runtime checking for stack overflow on subprogram entry. If a stack overflow is detected, a SIGSEGV segment fault will be raised. (SPARC only)

no%stkovf

Disable runtime checking for stack overflow. (SPARC only)

init_local

Perform special initialization of local variables.

The compiler initializes local variables to a value that is likely to cause an arithmetic exception if it is used by the program before it is assigned. Memory allocated by the ALLOCATE statement will also be initialized in this manner.

Module variables, SAVE variables, and variables in COMMON blocks are not initialized.

no%init_local

Disable local variable initialization. This is the default. 

%all

Turn on all these runtime checking features. 

%none

Disable all these runtime checking features. 

Stack overflows, especially in multithreaded applications with large arrays allocated on the stack, can cause silent data corruption in neighboring thread stacks. Compile all routines with -xcheck=stkovf if stack overflow is suspected. But note that compiling with this flag does not guarantee that all stack overflow situations will be detected since they could occur in routines not compiled with this flag.