Insure++ Reference - PARM_UNINIT_PTR
This error is generated whenever an uninitialized pointer is passed as
an argument to a function which expects an array parameter.
This code passes the uninitialized pointer a to routine
foo .
1: /*
2: * File: parmuptr.c
3: */
4: char foo(a)
5: char a[10];
6: {
7: return a[0];
8: }
9:
10: main()
11: {
12: char *a;
13:
14: foo(a);
15: return (0);
16: }
[parmuptr.c:6] **PARM_UNINIT_PTR**
1. >> {
2. Array parameter is uninitialized pointer: a
Stack trace where the error occurred:
3. foo() parmuptr.c, 6
main() parmuptr.c, 14
- Source line at which the problem was detected.
- Description of the problem and the argument 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: parmuptr.c (Modified)
*/
...
main()
{
char *a, b[10];
a = b;
foo(a);
}
PARM_NULL
PARM_WILD
|