title: Why does static initialization of flexible array member work?
body: <p>I have written the following basic code for a menu:</p>
  
  <pre><code>typedef struct Menu {
      char* title;
      unsigned num_submenus;
      struct Menu *submenu[];
  } Menu;
  
  Menu sub1 = {"Submenu 1", 0, {NULL}};
  Menu sub2 = {"Submenu 2", 0, {NULL}};
  Menu Main = {"Main Menu", 2, {&amp;sub1, &amp;sub2}};   /* No Error?! */
  
  int main()
  {
      printf("%s\n", Main.title);
      printf("%s\n", Main.submenu[0]-&gt;title);
      printf("%s\n", Main.submenu[1]-&gt;title);
  }
  </code></pre>
  
  <p>Browsing through a few related questions it seems like the only way to use a flexible array member is to dynamically allocate memory to it. However my compiler is perfectly happy to compile and run the code without any errors or warnings. Is this verboten?</p>
  
  <p>I am using MinGW gcc 4.6.1 and compiling under C99 rules.</p>