C11 6.2.7 p3:
— If both types are array types, the following rules are applied:
• If one type is an array of known constant size, the composite type is an array of
that size.
• Otherwise, if one type is a variable length array whose size is specified by an
expression that is not evaluated, the behavior is undefined.
• Otherwise, if one type is a variable length array whose size is specified, the
composite type is a variable length array of that size.
• Otherwise, if one type is a variable length array of unspecified size, the composite
type is a variable length array of unspecified size.
• Otherwise, both types are arrays of unknown size and the composite type is an
array of unknown size.
For this paragraph, I have the following several questions:
1.Could you give an example of the application of “Otherwise, if one type is a variable length array whose size is specified by an expression that is not evaluated, the behavior is undefined“?
2.If there are two variable length array types with specified sizes, then which size of the variable length array type is the composite type?
Jsut like the following code:
int n=2;
int m=3;
void f(char(*)[n]);
void f(char(*)[m]);
What is the composite type of the function f?
Thank you for your reading.