In this section:
A particularly difficult problem to track with conventional methods is that of incorrect return code from system functions. Insure++ is equipped with interface definitions for system libraries that enable it to check for errors when functions are called. Normally, these messages are suppressed, since applications often include their own handling for system calls that return errors. In some cases, however, it may be useful to enable these messages to track down totally unexpected behavior.
Code Description Enabled Reported Platform RETURN_FAILURE Function call returned an error Runtime Windows/Unix
The following code shows an application that will run out of memory.
Normally, the code will run without displaying any messages. If
RETURN_FAILURE messages are enabled, however, the following display will result.
- Line 2: Source line at which the problem was detected.
- Line 4: Description of the error and the parameters used.
- Line 6: Stack trace showing the function call sequence leading to the error.
These messages are normally suppressed but can be enabled by unsuppressing
RETURN_FAILURE in the Suppressions Control Panel.