<a href="http://llvm.org/bugs/show_bug.cgi?id=9751">http://llvm.org/bugs/show_bug.cgi?id=9751</a><div><br></div><div>-Wformat warnings will point to the format string, but no message at the call site.  This patch will move the warning to always point at the call site.  If the format string is part of the function call, one warning will show.  If the format string is defined elsewhere, a warning at the call site plus a note where the format string is defined.</div>
<div><br></div><div>Also, if a note is present, the fix-it would be moved to the note so they won't be applied with -fixit.  If the format string was used in multiple places, fixits may cause problems in other places.</div>
<div><br></div><div>printf("%d %d", 1);</div><div><br></div><div><div>warning: more '%' conversions than data arguments [-Wformat]</div><div>printf("%d %d", 1);</div><div>           ~^</div></div>
<div><br></div><div>const char kFormat[] = "%d %d";</div><div>printf(kFormat, 1);</div><div><br></div><div><div>test2.c:8:8: warning: more '%' conversions than data arguments [-Wformat]</div><div>printf(kFormat, 1);</div>
<div>       ^~~~~~~</div><div>test2.c:7:29: note: format string is defined here</div><div>const char kFormat[] = "%d %d";</div><div>                           ~^</div></div><div><br></div><div>Patch attached an available at <a href="http://codereview.appspot.com/5277043/">http://codereview.appspot.com/5277043/</a></div>