title: Is it legal to use a variable in a struct initializer in C?
body: <p>The following code seems to compile fine.</p>
  
  <pre><code>typedef struct Test {
    int i;
    int j;
  } Test;
  
  int main() {
    int i;
    i = 0;
    Test p = {i, 1};
    printf("%d\n", p.i);
    return 0;
  }
  </code></pre>
  
  <p>Splint fails with </p>
  
  <pre><code>example2.c:9:7: Parse Error. (For help on parse errors, see splint -help
             parseerrors.
  </code></pre>
  
  <p>(This is the line <code>Test p = {i, 1};</code>)</p>
  
  <p>Is this illegal C, or is this a bug in splint?</p>
  
  <p>(I want to do this because I want p to be <code>const</code>, although the failure seems to happen even when I remove the <code>const</code> modifier. If I move the declaration and initialization of <code>i</code> onto one line, the problem also seems to go away.)</p>