title: Is using array arguments in C considered bad practice?
body: <p>When declaring a function that accesses several consecutive values in memory, I usually use array arguments like</p>
  
  <pre><code>f(int a[4]);
  </code></pre>
  
  <p>It works fine for my purposes. However, I recently read <a href="https://lkml.org/lkml/2015/9/3/428" rel="nofollow noreferrer">the opinion of Linus Torvalds</a>.</p>
  
  <p>So I wonder if the array arguments are today considered obsolete? More particularly,</p>
  
  <ul>
  <li>is there any case where the compiler can utilize this information (array size) to check out-of-bound access, or</li>
  <li>is there any case where this technique brings some optimization opportunities?</li>
  </ul>
  
  <p>In any case, what about pointers to arrays?</p>
  
  <pre><code>void f(int (*a)[4]);
  </code></pre>
  
  <p>Note that this form is not prone to "sizeof" mistakes. But what about efficiency in this case? I know that GCC generates the same code (<a href="https://godbolt.org/z/5JhWYq" rel="nofollow noreferrer">link</a>). Is that always so? And what about further optimization opportunities in this case?</p>