Search

ParaSoft

HOME
PRODUCTS
SUPPORT
ABOUT
WHAT'S NEW
EVENTS


Insure++

Quick facts

Add-on Modules:
   -INUSE
   -TCA

Comparisons

Technical Papers

Support & Manuals

FAQs

Recent Reviews

User Testimonials

Press Releases


Insure tool to debug c++





Insure++ Reference - USER_ERROR



USER_ERROR

User generated error message

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.

Problem

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); bug
	11:		return (0);
	12:	}

Diagnosis (at runtime)

	[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
  1. Source line at which the problem was detected.
  2. Description of the error and the parameters used.
  3. Stack trace showing the function call sequence leading to the error.

Repair

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
Tools to debug c++ and java
(888) 305-0041 info@parasoft.com Copyright © 1996-2001 ParaSoft