By default, Purify does not modify the normal exit status of your program. However, you can have your program exit with a special exit status if Purify finds any access errors or memory leaks. This is a convenient way to flag failing runs in test suites.
Use the option -exit-status=yes to enable Purify to insert flags into your program's status on exit that indicate types of run-time errors. These are:
Unsuppressed Purify errors |
Bit OR'ed in exit status |
Memory access errors |
0x40 |
Memory leaks |
0x20 |
Potential memory leaks |
0x10 |
Alternatively, you can replace the call to exit(status) in your code, or the return status in main, with a call to the purify_exit(status) function. If you are concerned only about memory access errors, you can either turn off leak detection at exit using the option -leaks-at-exit=no, or you can suppress memory leak and potential leak messages. You can also ignore the appropriate bits of exit status.
The program summary message from Purify shows your original exit status before any other bits are OR'ed in.