Why don't pointer to VLA function parameters deduce their size automatically and is there currently any good usage of them? <p>As I understand it every VLA have an hidden variable of it's size which value can be 'acquired' by <code>sizeof</code> operator. What I don't get here is pointer to VLA's used in function parameters - why isn't their size automatically deduced and stored in this hidden variable - why we should explicitly provide it. And in this case why should we even use it given that we have already the type 'pointer to array of unknown size'?</p> <p>What I mean is this:</p> <pre><code>void func(size_t, int (*)[*]); //function accepting pointer to VLA void func_1(size_t, int (*)[]); //function accepting pointer to array of unknown bound void func(size_t sz, int (*parr)[sz]) //implementation of 'func' { printf("%lu", sizeof(*parr) / sizeof(int)); printf("%lu", sz); } void func_1(size_t sz, int(*parr)[]) //implementation of 'func_1' { //printf("%lu", sizeof(*parr) / sizeof(int)); //error: invalid application of 'sizeof' to an incomplete type 'int []' printf("%lu", sz); } </code></pre> <p>As I can see it the only benefit of using 'func' instead of 'func_1' is that 'sizeof' operator will return a copy of the initial value of 'sz'.</p> <p>Example usages of the above functions:</p> <pre><code>int main() { size_t sz = 3; int arr[sz]; func(sizeof(arr) / sizeof(int), &amp;arr); func_1(sizeof(arr) / sizeof(int), &amp;arr); return 0; } </code></pre> <p>Why can't the size of pointer to VLA parameter be assigned implicitly? This would at least make some good use of the syntax:</p> <pre><code>void func(int (*parr)[*]) // size copied from function argument { printf("%lu", sizeof(*parr) / sizeof(int)); printf("%lu", sz); } </code></pre> <p>And then calling the function like this:</p> <pre><code>int main() { size_t sz = 3; int arr[sz]; func(&amp;arr); return 0; } </code></pre> <p>Will cause array hidden size variable with value of '3' to be passed as hidden argument to 'func' creating code similar to instancing previous 'func' with current syntax and using 'sizeof' operator to passed array.</p> <p><em>If you're curios enough compiling the proposed syntax into whatever Clang compiler - you'll get an easter egg (;.</em> </p>