Specifying suppressions in a .purify file

You can specify suppressions directly as directives in a .purify file. The syntax is:

suppress <message-type> <function-call-chain>

For <message-type>, specify the three-character acronym for the message to be suppressed. You can use upper or lower case, and wildcards. For example, AB* matches ABR and ABW, while *W matches ABW, FMW, IPW, NPW, SBW, WPW and ZPW.

For <function-call-chain>, specify a list of function names separated by semicolons. You can replace or augment a function name by specifying a filename enclosed in double quotes. Purify compares the filename to source, object, or library names. You can use wildcards for function and filenames. An unqualified filename (containing no '/') matches the specified file in any directory; a qualified filename must match exactly to suppress the message.

For example,

suppress ABR sortFunction; sort*; qsort "libc*"

suppresses ABR messages in the sortFunction function whenever it is called from a function with the prefix sort, which in turn is called from the qsort function in the libc library in any directory.

Using "..." syntax

You can use "..." syntax for floating or unanchored matches. For example,

suppress UMR ...; Xm*

suppresses UMR messages in any function beginning with Xm or any function called directly or indirectly from such a function.

You can use "..." syntax in the middle of a chain. For example,

suppress ABW tzsetwall; ...; main

suppresses ABW messages in tzsetwall when called at any level below main.

Using "..." syntax is more time-consuming than simple pattern matches because it causes Purify to match every address in the call chain with the function name. Without "...", Purify can usually make a match at the first name.

"..." reaches only as far as the recorded call chain. For example, Purify does not suppress a UMR message that is 27 levels below XmInit, if the -chain-length option is set to the default of 6.

Suppressing error messages in C++ code

To suppress messages in C++ code, use natural C++ notation, including the function or method argument signature. You cannot use a mangled function name as reported by tools like nm.

If you do not include the argument signature, Purify matches any overloaded function of the specified name. For example,

suppress FNH Test::Test

suppresses FNH errors in all Test::Test functions regardless of their argument signature. However,

suppress FNH Test::Test()

suppresses only the error in Test with zero arguments. So, for example, it would not suppress errors in a Test::Test(const char*)function.

Suppressing messages in the Hello World example

In the Hello World program example supplied with the Purify program in <purifyhome>/example, Purify reports an ABR error. You can suppress this message by using any of the following suppression directives: