Sun Studio 12: C User's Guide

B.2.78 -xcheck[=o]

(SPARC) Compiling with -xcheck=stkovf adds a runtime check for stack overflow of the main thread in a singly-threaded program as well as slave-thread stacks in a multithreaded program. If a stack overflow is detected, a SIGSEGV is generated. If your application needs to handle a SIGSEGV caused by a stack overflow differently than it handles other address-space violations, see sigaltstack(2).

You can substitute one of the following values for o:

Table B–18 The -xcheck Flags




Perform none of the -xcheck checks.


Perform all of the -xcheck checks.


Turns on stack-overflow checking. 


Turns off stack-overflow checking. 

If you do not specify -xcheck, the compiler defaults to-xcheck=%none. If you specify -xcheck without any arguments, the compiler defaults to-xcheck=%all which turns on the runtime check for stack overflow.

The -xcheck option does not accumulate on the command line. The compiler sets the flag in accordance with the last occurrence of the command.