#pragma options [no]check
Generates code that performs certain types of runtime checking.
If a violation is encountered, a runtime error is raised by sending a SIGTRAP signal to the process. Note that the runtime checks may result in slower application execution.
.-nocheck-------------------------. >>- -q--+-check--+----------------------+-+-------------------->< | .-:-------------. | | V .-all-------. | | '-=----+-bounds----+-+-' +-nobounds--+ +-divzero---+ +-nodivzero-+ +-nullptr---+ '-nonullptr-'
-qnocheck
This suboption has no effect on accesses to a variable length array.
Specifying the -qcheck option with no suboptions is equivalent to -qcheck=all.
You can specify the -qcheck option more than once. The suboption settings are accumulated, but the later suboptions override the earlier ones.
xlc myprogram.c -qcheck=all:nonullptrprovides checking for everything except for addresses contained in pointer variables used to reference storage. If you use all with the no... form of the suboptions, all should be the first suboption.
None.
void func1(int* p) { *p = 42; /* Traps if p is a null pointer */ } void func2(int i) { int array[10]; array[i] = 42; /* Traps if i is outside range 0 - 9 */ }
void func3(int a, int b) { a / b; /* Traps if b=0 */ }