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:




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)


Disable runtime checking for stack overflow. (SPARC only)


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.


Disable local variable initialization. This is the default. 


Turn on all these runtime checking features. 


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.