Insure++ Reference - COPY_UNINIT_PTR
This error is generated whenever an uninitialized pointer is copied.
This error category will be disabled if full uninitialized memory
checking is in effect (the default). In this case, errors are detected
in the READ_UNINIT_MEM category instead.
The pointer a is declared in line 5, but is never
initialized. Therefore, when an attempt is made in line 7 to copy this
pointer to b , an error is generated.
1: /*
2: * File: copyunin.C
3: */
4: int main() {
5: char *a, *b;
6:
7: b = a;
8: return 0;
9: }
1. [copyunin.C:7] **COPY_UNINIT_PTR**
>> b = a;
2. Copying uninitialized pointer: a
3. Stack trace where the error occurred:
main() copyunin.C, 7
- Source line at which the problem was detected.
- Brief description of the problem.
- Stack trace showing the function call sequence leading to
the error.
This problem is usually caused by omitting an assignment or allocation
statement that would initialize a pointer. The example code given could
be corrected by assigning a value to a before
reaching line 7.
COPY_DANGLING
COPY_WILD
|