 <p>The true C99 way to do this is to have:</p> <pre><code>int f(int p[static 4]) { p[0] = 1; p[1] = 2; p[2] = 3; p[3] = 4; return c; } </code></pre> <p>The <code>static 4</code> inside the square brackets indicates to the compiler that the function expects an array of <em>at least</em> 4 elements. clang will issue a warning if it knows at compile-time that the value you are passing to <code>f</code> doesn't contain at least 4 elements. GCC may warn too but I don't use this compiler often.</p>