Insure++ Reference - READ_UNINIT_PTR
This error is generated whenever an uninitialized pointer is
dereferenced.
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.
This code attempts to use the value of the pointer a ,
even though it has never been initialized.
1: /*
2: * File: readuptr.c
3: */
4: main()
5: {
6: int b, *a;
7:
8: b = *a;
9: return (0);
10: }
[readuptr.c:8] **READ_UNINIT_PTR**
1. >> b = *a;
2. Reading uninitialized pointer: a
Stack trace where the error occurred:
3. main() readuptr.c, 8
- Source line at which the problem was detected.
- Description of the problem and the expression that is in error.
- 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 code given, for example,
could be corrected by including an assignment as shown below.
/*
* File: readuptr.c (Modified)
*/
main()
{
int b, *a, c;
a = &c;
b = *a;
return (0);
}
READ_UNINIT_MEM
READ_WILD
|