Download LabWindows/CVI Programmer Reference Manual
Transcript
Chapter 1 LabWindows/CVI Compiler Error categories include pointer protection, dynamic memory protection, general protection errors, and library protection. Each of these categories includes subgroups as described in the following sections. Array Indexing and Pointer Protection Errors The pointer protection errors catch invalid operations with pointers and arrays. In this section, these errors are grouped by the type of expression that causes the error or the type of invalid pointer involved. Pointer Arithmetic (Non-Fatal) Pointer arithmetic expressions involve a pointer sub-expression and an integer sub-expression. LabWindows/CVI generates an error when the pointer sub-expression is invalid or when the arithmetic operation results in an invalid pointer expression. The following user protection errors involve pointer arithmetic. • Pointer arithmetic involving uninitialized pointer • Pointer arithmetic involving null pointer • Out-of-bounds pointer arithmetic (calculation of an array address that results in a pointer value either before the start or past the end of the array) • Pointer arithmetic involving pointer to freed memory • Pointer arithmetic involving invalid pointer • Pointer arithmetic involving address of non-array object • Pointer arithmetic involving pointer to function • Array index too large • Negative array index Pointer Assignment (Non-Fatal) LabWindows/CVI generates pointer assignment errors when you assign invalid values to pointer variables. These warnings can help determine when a particular pointer becomes invalid. The following user protection errors involve pointer assignment. • Assignment of uninitialized pointer value • Assignment of out-of-bounds pointer expression (assignment of an address before the start or past the last element of an array) • Assignment of pointer to freed memory • Assignment of invalid pointer expression LabWindows/CVI Programmer Reference Manual 1-8 www.ni.com