Insure++ Reference - FUNC_BAD
This error is generated when an attempt is made to call a function
through an invalid function pointer.
One simple way to generate this error is through the use of the
union data type. If the union contains a function pointer
which is invoked after initializing some other union member, this error
can occur.
1: /*
2: * File: funcbad.c
3: */
4: union {
5: int *iptr;
6: int (*fptr)();
7: } u;
8:
9: main()
10: {
11: int i;
12:
13: u.iptr = &i;
14: u.fptr();
15: return (0);
16: }
[funcbad.c:14] **FUNC_BAD**
1. >> u.fptr();
2. Function pointer is not a function: u.fptr
3. Pointer : 0xf7fff8cc
In block : 0xf7fff8cc thru 0xf7fff8cf
4. (4 bytes,1 element)
i, declared at funcbad.c, 11
Stack trace where the error occurred:
5. main() funcbad.c, 14
6. **Memory corrupted. Program may crash!!**
- Source line at which the problem was detected.
- Description of the problem and the expression that is in error.
- The value of the pointer through which the call is being
attempted.
- Description of the memory block to which this pointer actually
points, including its size and the source line of its
declaration.
- Stack trace showing the function call sequence leading to the
error.
- Informational message indicating that a serious error has
occurred which may cause the program to crash.
The description of the memory block to which the pointer points should
enable you to identify the statement which was used to assign the function
pointer incorrectly.
FREE_WILD
FUNC_NULL
|