27-10-2017, 04:23 PM
What exactly is meant by the "use" of "variable-length array types"? The examples suggest that the mere declaration of an object of variable length array type violates this rule which makes sense if the declaration is thought of as "using" the VLA type.
The example below declares a pointer to a VLA type and then dereferences the pointer:
Is the declaration of the pointer parameter ary a violation of this rule? Is the statement that dereferences ary a violation of this rule?
The example below declares a pointer to a VLA type and then dereferences the pointer:
Code:
typedef unsigned uint32_t;
typedef int int32_t;
void foo(uint32_t sz, int32_t (*ary)[sz], int32_t val) {
(*ary)[0] = val;
}
Is the declaration of the pointer parameter ary a violation of this rule? Is the statement that dereferences ary a violation of this rule?
<t></t>