title: printf, wprintf, %s, %S, %ls, char* and wchar*: Errors not announced by a compiler warning?
body: <p>I have tried the following code:</p>
  
  <pre><code>wprintf(L"1 %s\n","some string"); //Good
  wprintf(L"2 %s\n",L"some string"); //Not good -&gt; print only first character of the string
  printf("3 %s\n","some string"); //Good
  //printf("4 %s\n",L"some string"); //Doesn't compile
  printf("\n");
  wprintf(L"1 %S\n","some string"); //Not good -&gt; print some funny stuff
  wprintf(L"2 %S\n",L"some string"); //Good
  //printf("3 %S\n","some string"); //Doesn't compile
  printf("4 %S\n",L"some string");  //Good
  </code></pre>
  
  <p>And I get the following output:</p>
  
  <pre><code>1 some string
  2 s
  3 some string
  
  1 g1 %s
  
  2 some string
  4 some string
  </code></pre>
  
  <p>So: it seems that both <code>wprintf</code> and <code>printf</code> are able to print correctly both a char* and a wchar*, but only if the exact specifier is used. <strong>If the wrong specifier is used, you might not get a compiling error (nor warning!) and end up with wrong behavior.</strong> Do you experience the same behaviour?</p>
  
  <p>Note: This was tested under Windows, compiled with MinGW and <strong>g++</strong> 4.7.2 (I will check gcc later)</p>
  
  <p>Edit: I also tried %ls (result is in the comments)</p>
  
  <pre><code>printf("\n");
  wprintf(L"1 %ls\n","some string"); //Not good -&gt; print funny stuff
  wprintf(L"2 %ls\n",L"some string"); //Good
  // printf("3 %ls\n","some string"); //Doesn't compile
  printf("4 %ls\n",L"some string");  //Good
  </code></pre>