This page provides an overview of each error code. The following sections provide a detailed description of each error including:

  • A brief explanation of what problem has been detected.
  • An example program that generates a similar error.
  • Output that would be generated by running the example, with annotations indicating what the various pieces of the diagnostic mean and how they should be interpreted in identifying your own problems. The exact appearance of the error message may depend on how Insure++ is currently configured.
  • A brief description of ways in which the problem might be eliminated.

Sometimes you will see values identified as <argument #> or <return> instead of names from your program. In this case, <argument n> refers to the nth argument passed to the current function (i.e., the argument where the error was detected), and <return> refers to a value returned from the function indicated.

ALLOC_CONFLICT

CodeDescriptionEnabledReported
ALLOC_CONFLICTMixing malloc/free with new/ delete(tick)Runtime
(badfree)

Memory was allocated with new or new[] and an attempt was made to free it with free.

(tick)Runtime
(baddelet)

Memory was allocated with malloc and an attempt was made to free it with delete or delete[].

(tick)Runtime
(badhandle)

Memory is allocated by one heap and freed by a different heap

(tick)Runtime

 

BAD_CAST

CodeDescriptionEnabledReported
BAD_CASTCast of pointer loses precision(tick)Compilation

 

BAD_DECL

CodeDescriptionEnabledReported
BAD_DECLIncompatible global declarations(tick)Runtime

 

BAD_FORMAT

CodeDescriptionEnabledReported
BAD_DECLIncompatible global declarations(error)

Compilation

Runtime

(sign)Types differ only by sign, e.g., int vs. unsigned int(error)Compilation
(compatible)Fundamental types are different but they happen to have the same representation on the particular hardware in use, e.g., int vs. long on machines where both are 32-bits, or int * vs. long where both are 32-bits.(error)Compilation
(incompatible)Fundamental types are different, e.g., int vs. double(tick)Runtime
(other)A problem other than an argument type mismatch is detected, such as passing the wrong number of arguments. Error messages are classified according to this scheme and can be selectively enabled or disabled(tick)Compilation

 

BAD_PARM

CodeDescriptionEnabledReported
BAD_PARMMismatch in argument type.(error)

Compilation

(sign)Types differ only by sign, e.g., int vs. unsigned int(error)Compilation
(compatible)

Fundamental types are different but they happen to have the same representation on the particular hardware in use, e.g., int vs. long on machines where both are 32-bits.

(error)Compilation
(incompatible)Fundamental types are different, e.g., int vs. double(tick)Compilation
(pointer)

This is not an error class, but a keyword used to suppress messages about mismatched pointer types, such as int * vs. char *.

(tick)Compilation
(union)

Forces a declared union argument to match only a similar union as an actual argument. If this is suppressed, you may pass any of the individual union elements to the routine, rather than the union type, or pass a union to a routine which expects one of the union-elements as an argument.

(tick)Compilation
(other)A problem other than an argument type mismatch is detected, such as passing the wrong number of arguments. Error messages are classified according to this scheme and can be selectively enabled or disabled(tick)Compilation

 

BOGUS_LEAK

CodeDescriptionEnabledReported
BOGUS_LEAKRuntime leak not found during execution(tick)Runtime

 

COPY_BAD_RANGE

CodeDescriptionEnabledReported
COPY_BAD_RANGE

Attempt to copy out-of-range pointer

(error)Runtime

 

COPY_DANGLING

CodeDescriptionEnabledReported
COPY_DANGLING

Attempt to copy dangling pointer

(error)Runtime

 

COPY_UNINIT_PTR

CodeDescriptionEnabledReported
COPY_UNINIT_PTR

Attempt to copy uninitialized pointer

(error)Runtime

 

COPY_WILD

CodeDescriptionEnabledReported
COPY_UNINIT_PTR

Attempt to copy a wild pointer

(error)Runtime

 

DEAD_CODE

CodeDescriptionEnabledReported
DEAD_CODE

Code is not evaluated, has no effect, or is unreachable

(error)

Compilation

(emptyloopbody)Loop body is empty.(error)Compilation
(emptystmt)The statement is empty.(error)Compilation
(noeffect)Code has no effect.(error)Compilation
(notevaluated)Code is not evaluated.(error)Compilation

 

DELETE_MISMATCH

CodeDescriptionEnabledReported
DELETE_MISMATCH

Mismatch between new/new[] and delete/delete[]

(error)Runtime
(bracket)

new, delete[]

(tick)Runtime
(nobracket)

new[], delete

(tick)Runtime

 

EXPR_BAD_RANGE

CodeDescriptionEnabledReported
EXPR_BAD_RANGE

Expression exceeded range

(error)Runtime

 

EXPR_DANGLING

CodeDescriptionEnabledReported
EXPR_DANGLING

Expression uses a dangling pointer

(error)Runtime

 

EXPR_NULL

CodeDescriptionEnabledReported
EXPR_NULL

Expression uses NULL pointer

(tick)Runtime

 

EXPR_UNINIT_PTR

CodeDescriptionEnabledReported
EXPR_UNINIT_PTR

Expression uses uninitialized pointer

(tick)Runtime

 

EXPR_UNRELATED_PTRCMP

CodeDescriptionEnabledReported
EXPR_UNRELATED_PTRCMP

Expression compares unrelated pointers

(tick)Runtime

 

EXPR_UNRELATED_PTRDIFF

CodeDescriptionEnabledReported
EXPR_UNRELATED_PTRDIFF

Expression subtracts unrelated pointers

(tick)Runtime

 

EXPR_WILD

CodeDescriptionEnabledReported
EXPR_WILD

Expression uses a wild pointer

(error)Runtime

 

FREE_BODY

CodeDescriptionEnabledReported
FREE_BODY

Freeing memory block from body

(tick)Runtime

 

FREE_DANGLING

CodeDescriptionEnabledReported
FREE_DANGLING

Freeing dangling pointer

(tick)Runtime

 

FREE_GLOBAL

CodeDescriptionEnabledReported
FREE_GLOBAL

Freeing global memory

(tick)Runtime

 

FREE_LOCAL

CodeDescriptionEnabledReported
FREE_LOCAL

Freeing local memory

(tick)Runtime

 

FREE_NULL

CodeDescriptionEnabledReported
FREE_NULL

Freeing null pointer

(tick)Runtime

 

FREE_UNINIT_PTR

CodeDescriptionEnabledReported
FREE_UNINIT_PTR

Freeing uninitialized pointer

(tick)Runtime

 

FREE_WILD

CodeDescriptionEnabledReported
FREE_WILD

Freeing wild pointer

(tick)Runtime

 

FUNC_BAD

CodeDescriptionEnabledReported
FUNC_BAD

Function pointer is not a function

(tick)Runtime

 

FUNC_NULL

CodeDescriptionEnabledReported
FUNC_NULL

Function pointer is NULL

(tick)Runtime

 

FUNC_UNINIT_PTR

CodeDescriptionEnabledReported
FUNC_UNINIT_PTR

Function pointer is uninitialized

(tick)Runtime

 

HEAP_CORRUPT

CodeDescriptionEnabledReported
HEAP_CORRUPT

Dynamic memory heap is corrupt

(tick)Runtime

 

INSURE_ERROR

CodeDescriptionEnabledReported
INSURE_ERROR

Various internal errors

(tick)Runtime, Compilation

 

INSURE_WARNING

CodeDescriptionEnabledReported
INSURE_WARNING

Errors from iic_warning calls

(error)Compilation

 

LEAK_ASSIGN

CodeDescriptionEnabledReported
LEAK_ASSIGN

Memory leaked as a result of pointer reassignment

(tick)Runtime

 

LEAK_FREE

CodeDescriptionEnabledReported
LEAK_ASSIGN

Memory leaked freeing block

(tick)Runtime

 

LEAK_RETURN

CodeDescriptionEnabledReported
LEAK_RETURN

Memory leaked by ignoring returned value

(tick)Runtime

 

LEAK_SCOPE

CodeDescriptionEnabledReported
LEAK_RETURN

Memory leaked leaving scope

(tick)Runtime

 

PARM_BAD_RANGE

CodeDescriptionEnabledReported
PARM_BAD_RANGE

Array parameter exceeded range

(tick)Runtime

 

PARM_DANGLING

CodeDescriptionEnabledReported
PARM_DANGLING

Array parameter is a dangling pointer

(tick)Runtime

 

PARM_NULL

CodeDescriptionEnabledReported
PARM_NULL

Array parameter is NULL

(tick)Runtime

 

PARM_UNINIT_PTR

CodeDescriptionEnabledReported
PARM_UNINIT_PTR

Array parameter is an uninitialized pointer

(tick)Runtime

 

PARM_WILD

CodeDescriptionEnabledReported
PARM_WILD

Array parameter is wild

(tick)Runtime

 

PARSE_ERROR

CodeDescriptionEnabledReported
PARSE_ERROR

Unidentified error

(tick)Compilation

 

PARSE_WARNING

CodeDescriptionEnabledReported
PARSE_WARNING

Variable declared but never used

(error)Compilation

 

READ_BAD_INDEX

CodeDescriptionEnabledReported
READ_BAD_INDEX

Reading array out of range

(tick)Runtime

 

READ_DANGLING

CodeDescriptionEnabledReported
READ_DANGLING

Reading from a dangling pointer

(tick)Runtime

 

READ_NULL

CodeDescriptionEnabledReported
READ_NULL

Reading NULL pointer

(tick)Runtime

 

READ_OVERFLOW

CodeDescriptionEnabledReported
READ_OVERFLOW
(error)Runtime
(normal)Reading overflow's memory(tick)Runtime
(nonull)

String is not NULL-terminated within range

(tick)Runtime
(string)

Alleged string does not begin within legal range

(tick)Runtime
(struct)

Structure reference out of range

(tick)Runtime

 

READ_UNINIT_MEM

CodeDescriptionEnabledReported
READ_UNINIT_MEMReading uninitialized memory(error)Runtime
(copy)

Copy from uninitialized region

(error)Runtime
(read)

Use of uninitialized value

(tick)Runtime

 

READ_UNINIT_PTR

CodeDescriptionEnabledReported
READ_UNINIT_PTRReading from uninitialized pointer(tick)Runtime

 

READ_WILD

CodeDescriptionEnabledReported
READ_WILDReading wild pointer(tick)Runtime

 

RETURN_DANGLING

CodeDescriptionEnabledReported
RETURN_DANGLINGReturning pointer to local variable(tick)Compilation

 

RETURN_FAILURE

CodeDescriptionEnabledReported
RETURN_FAILUREFunction call returned an error(error)Runtime

 

RETURN_INCONSISTENT

CodeDescriptionEnabledReported
RETURN_INCONSISTENTFunction has inconsistent return type(error)Compilation
(level 1)No declaration, returns nothing(error)Compilation
(level 2)Declared int, returns nothing(tick)Compilation
(level 3)Declared non-int, returns nothing(tick)Compilation
(level 4)Returns different types at different statements(tick)Compilation

 

STL_ERROR

Insure++ can detect several STL usage errors on Unix systems:

UNUSED_VAR

CodeDescriptionEnabledReported
UNUSED_VARUnused variables(error)Compilation
(assigned)Variable is assigned but never used(error)Compilation
(unassigned)Variable is never used(error)Compilation

 

USER_ERROR

CodeDescriptionEnabledReported
USER_ERRORUser-generated error message(tick)Runtime

 

WRITE_BAD_INDEX

CodeDescriptionEnabledReported
WRITE_BAD_INDEXWriting array out of range(tick)Runtime

 

WRITE_DANGLING

CodeDescriptionEnabledReported
WRITE_DANGLINGWriting to a dangling pointer(tick)Runtime

 

WRITE_NULL

CodeDescriptionEnabledReported
WRITE_NULLWriting to a NULL pointer(tick)Runtime

 

WRITE_OVERFLOW

CodeDescriptionEnabledReported
WRITE_OVERFLOW
(error)Runtime
(normal)Writing overflows memory(tick)Runtime
(struct)Structure references out of range(tick)Runtime

 

WRITE_UNINIT_PTR

CodeDescriptionEnabledReported
WRITE_UNINIT_PTRWriting to an uninitialized pointer(tick)Runtime

 

WRITE_WILD

CodeDescriptionEnabledReported
WRITE_WILDWriting to a wild pointer(tick)Runtime

 



  • No labels