title: Why does gcc -Wall give warning about zero-length format string?
body: <p>I searched around a little bit for information on this but didn't find anything satisfactory.  Is there some special behavior to the function call</p>
  
  <pre><code>sprintf(someString, "");
  </code></pre>
  
  <p>that explains why this is warning (on gcc with -Wall)?  I only managed to find that the C standard allows zero-length format strings.</p>
  
  <p>I tried the following example</p>
  
  <pre><code>#include &lt;stdio.h&gt;
  
  int main()
  {
      char str[2] = {'a', 'a'};
      sprintf(str, "");
      printf("\'%c\'\'%c\'\n", str[0], str[1]);
      return 0;
  }
  </code></pre>
  
  <p>which prints out</p>
  
  <pre><code>'''a'
  </code></pre>
  
  <p>which is exactly what I expected to see.
  So, why the warning?</p>