<html><head><meta http-equiv="Content-Type" content="text/html; charset=utf-8"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; line-break: after-white-space;" class=""><br class=""><div><br class=""><blockquote type="cite" class=""><div class="">On May 13, 2018, at 8:18 PM, James Y Knight via cfe-dev <<a href="mailto:cfe-dev@lists.llvm.org" class="">cfe-dev@lists.llvm.org</a>> wrote:</div><br class="Apple-interchange-newline"><div class=""><div dir="ltr" class=""><div dir="auto" class=""><font face="arial, helvetica, sans-serif" size="2" class=""><br class=""><br class=""></font><div class="gmail_quote" dir="auto"><div dir="ltr" class=""><font face="arial, helvetica, sans-serif" size="2" class="">On Fri, May 11, 2018, 7:26 PM Shoaib Meenai via cfe-dev <<a href="mailto:cfe-dev@lists.llvm.org" target="_blank" class="">cfe-dev@lists.llvm.org</a>> wrote:<br class=""></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" class="">
<div class="m_7345374894159123709m_4917890755911157055WordSection1"><p class="MsoNormal"><font face="arial, helvetica, sans-serif" size="2" class="">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 class=""> </div></div><div dir="auto" class=""><font face="arial, helvetica, sans-serif" size="2" class="">+1 to change the default behavior and put the stricter checks in another flag, for all the reasons discussed already.</font></div></div></div></div></blockquote><div><br class=""></div><div><br class=""></div><div>Sounds like there’s support for doing this.</div><div><br class=""></div><div>Shoaib, how would you rather proceed?</div><div><br class=""></div><br class=""><blockquote type="cite" class=""><div class=""><div dir="ltr" class=""><div dir="auto" class=""><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" class=""><div class="m_7345374894159123709m_4917890755911157055WordSection1"><p class="MsoNormal"><font face="arial, helvetica, sans-serif" size="2" class="">
 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 class=""> </div></div><div dir="auto" class=""><font face="arial, helvetica, sans-serif" size="2" class="">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" class=""><br class=""></div><div class="">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 class=""><br class=""></div></div></div>
_______________________________________________<br class="">cfe-dev mailing list<br class=""><a href="mailto:cfe-dev@lists.llvm.org" class="">cfe-dev@lists.llvm.org</a><br class="">http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev<br class=""></div></blockquote></div><br class=""></body></html>