Why declare a static variable in main?
<p>Reading over someone else's code, I saw something syntactically similar to this:</p>

<pre><code>int main(void) {
    static int attr[] = {FOO, BAR, BAZ, 0};
    /* ... */
}
</code></pre>

<p>Is this an error or is there some reason to declare a variable in <code>main</code> <code>static</code>? As I understand it <code>static</code> prevents linkage and maintains value between invocations. Because here it's inside a function it only does the latter, but <code>main</code> is only invoked once so I don't see the point. Does this modify some compilation behavior (e.g. preventing it from being optimized out of existence)?</p>