Insure++ Reference - USER_ERROR
This error is generated when a program violates a rule specified in an
interface module. These normally check that parameters passed to system
level or user functions fall within legal ranges or are otherwise valid.
This behavior is different from the
RETURN_FAILURE
error code, which normally indicates that the call to the function was
made with valid data, but that it still returned an error for some,
possibly anticipated, reason.
These problems fall into many different categories. A particularly
simple example is shown in the following code, which
calls the sqrt function and passes it a negative
argument.
1: /*
2: * File: usererr.c
3: */
4: #include <math.h>
5:
6: main()
7: {
8: double q;
9:
10: q = sqrt(-2.0);
11: return (0);
12: }
[usererr.c:10] **USER_ERROR**
1. >> q = sqrt(-2.0);
2. Negative number -2.000000 passed to sqrt:
Stack trace where the error occurred:
3. main() usererr.c, 10
- Source line at which the problem was detected.
- Description of the error and the parameters used.
- Stack trace showing the function call sequence leading to
the error.
Each message in this category is caused by a different problem, which
should be evident from the printed diagnostic. Usually, these checks
revolve around the legality of various arguments to functions.
These messages can be suppressed by adding the option
insure++.suppress USER_ERROR
to your .psrc file.
UNUSED_VAR
VIRTUAL_BAD
|