<div dir="ltr"><div dir="auto"><font face="arial, helvetica, sans-serif" size="2"><br><br></font><div class="gmail_quote" dir="auto"><div dir="ltr"><font face="arial, helvetica, sans-serif" size="2">On Fri, May 11, 2018, 7:26 PM Shoaib Meenai via cfe-dev <<a href="mailto:cfe-dev@lists.llvm.org" target="_blank">cfe-dev@lists.llvm.org</a>> wrote:<br></font></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">





<div lang="EN-US" link="#0563C1" vlink="#954F72">
<div class="m_7345374894159123709m_4917890755911157055WordSection1">
<p class="MsoNormal"><font face="arial, helvetica, sans-serif" size="2">What are people's thoughts here? Are there preferences for relaxing -Wformat and adding a new option for strict format warnings vs. keeping -Wformat as-is and adding a new option for relaxed format warnings?</font></p></div></div></blockquote><div> </div></div><div dir="auto"><font face="arial, helvetica, sans-serif" size="2">+1 to change the default behavior and put the stricter checks in another flag, for all the reasons discussed already.</font></div><div dir="auto"><font face="arial, helvetica, sans-serif" size="2"><br></font></div><div class="gmail_quote" dir="auto"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div lang="EN-US" link="#0563C1" vlink="#954F72"><div class="m_7345374894159123709m_4917890755911157055WordSection1"><p class="MsoNormal"><font face="arial, helvetica, sans-serif" size="2">
 Of course, we should also ensure that the optimizer doesn't do anything surprising when there's a type mismatch between the specifier and the argument but both types have the same size and alignment (i.e., the case where the relaxed format warning won't fire),
 both now and in the future.</font></p></div></div></blockquote><div> </div></div><div dir="auto"><font face="arial, helvetica, sans-serif" size="2">I think the concern here would be if clang did calling convention lowering by generating a store of the outgoing argument with tbaa attached, and then also generated a (potentially mismatched) tbaa-annotated load for the call to va_arg inside the printf function. And then optimized the two functions together.</font></div><div dir="auto"><br></div><div>I don't believe that can happen, both because the call arguments are not lowered to memory stores (if needed) by clang, but rather by llvm (there's no real possibility to attach TBAA at that point, even if we wanted to), and also because clang doesn't attach tbaa to the loads generated by va_arg.</div><div><br></div></div></div>