<div dir="ltr">It looks to me as if all of the false-positives so far have been <i><b>not arrays but structs</b></i>.<div><br></div><div>struct X { int a; const char *b; int c; };</div><div>X x = { 41, "forty" "two", 43 };  // false-positive here</div><div><br></div><div>The distinguishing feature here is that if you did insert a comma as suggested by the compiler, then the result would no longer type-check.</div><div><div>X x = { 41, "forty", "two", 43 };  // this is ill-formed because "two" is not a valid initializer for `int c`</div><div><br></div><div>Dávid, can you use this in some way?</div><div>IMHO it would be appropriate to just turn the warning off if the entity being initialized is a struct — leave the warning enabled only for initializers of arrays.</div><div><br></div><div>my $.02,</div><div>–Arthur</div><div></div></div><div><br></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Mon, Aug 10, 2020 at 5:38 PM Dávid Bolvanský <<a href="mailto:david.bolvansky@gmail.com">david.bolvansky@gmail.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">I moved it to -Wextra due to false positives.<br>
<br>
> Should there be some exception for line length<br>
<br>
Yeah, but sure how to define the threshold or so. :/<br>
<br>
po 10. 8. 2020 o 23:21 dmajor via Phabricator<br>
<<a href="mailto:reviews@reviews.llvm.org" target="_blank">reviews@reviews.llvm.org</a>> napísal(a):<br>
><br>
> dmajor added a comment.<br>
><br>
> In the Firefox repo this warning is firing on a number of strings that were broken up by clang-format (or humans) for line length, for example <a href="https://searchfox.org/mozilla-central/rev/ab81b8552f4aa9696a2524f97fdfeb59d4dc31c1/security/certverifier/ExtendedValidation.cpp#176-178" rel="noreferrer" target="_blank">https://searchfox.org/mozilla-central/rev/ab81b8552f4aa9696a2524f97fdfeb59d4dc31c1/security/certverifier/ExtendedValidation.cpp#176-178</a> or <a href="https://searchfox.org/mozilla-central/rev/ab81b8552f4aa9696a2524f97fdfeb59d4dc31c1/xpcom/tests/gtest/TestEscape.cpp#103-104" rel="noreferrer" target="_blank">https://searchfox.org/mozilla-central/rev/ab81b8552f4aa9696a2524f97fdfeb59d4dc31c1/xpcom/tests/gtest/TestEscape.cpp#103-104</a> or <a href="https://searchfox.org/mozilla-central/rev/ab81b8552f4aa9696a2524f97fdfeb59d4dc31c1/js/src/jsapi-tests/testXDR.cpp#115" rel="noreferrer" target="_blank">https://searchfox.org/mozilla-central/rev/ab81b8552f4aa9696a2524f97fdfeb59d4dc31c1/js/src/jsapi-tests/testXDR.cpp#115</a>.<br>
><br>
> Do you consider these to be false positives in your view? Should there be some exception for line length, perhaps?<br>
><br>
><br>
> Repository:<br>
>   rG LLVM Github Monorepo<br>
><br>
> CHANGES SINCE LAST ACTION<br>
>   <a href="https://reviews.llvm.org/D85545/new/" rel="noreferrer" target="_blank">https://reviews.llvm.org/D85545/new/</a><br>
><br>
> <a href="https://reviews.llvm.org/D85545" rel="noreferrer" target="_blank">https://reviews.llvm.org/D85545</a><br>
><br>
</blockquote></div>