title: "redeclaration of symbol with no linkage" when used on function scope
body: <p>At file scope I can use a forward declaration of in initialized (static) variable.  There is a cyclic dependency. <code>s[0]</code> refers to the address of <code>count</code>. <code>count</code> refers to the count of items in <code>s</code>.</p>
  
  <pre><code>struct s { int *a; };
  
  static int count;
  int data1;
  static struct s s[] = {
      &amp;count, &amp;data1 // , ... a lot more
  };
  static int count = sizeof(s) / sizeof(s[0]);
  </code></pre>
  
  <p>As shown in <a href="https://stackoverflow.com/questions/8124682/error-redeclaration-with-no-linkage">this StackOverflow question</a> it is not possible to use the same construct at function (or block) scope.</p>
  
  <pre><code>void foo(void)
  {
      static int count;
      static struct s s[] = {
          &amp;count, &amp;data1 // , ... a lot more
      };
      static int count = sizeof(s) / sizeof(s[0]);
  }
  </code></pre>
  
  <p>It results in the error message</p>
  
  <pre><code>redeclaration of 'count' with no linkage.
  </code></pre>
  
  <p>The objective is to define a huge set of functions that have such tables. I am reluctant to define a second huge set of variables at file scope. Is there a way to define such variables at function scope?</p>
  
  <p><strong>EDIT:</strong> The code did not include one important thing. I missed the <code>static</code> before the initialized structure. This is essential since the array should not be built on each call.</p>