<div dir="ltr"><div dir="ltr">Re "intentional?", it matches gcc which explicitly documents on <a href="https://gcc.gnu.org/onlinedocs/gcc/Diagnostic-Pragmas.html">https://gcc.gnu.org/onlinedocs/gcc/Diagnostic-Pragmas.html</a> that the pragma wins over -Werror.</div><div dir="ltr"><br></div><div>Does anyone know if there's a flag that says "I want all warnings to be errors, not just most of them"?</div><div><br></div><div>If there isn't one yet, what would be a good UI for that?</div></div><br><div class="gmail_quote"><div dir="ltr">On Wed, Jan 23, 2019 at 11:11 PM Nico Weber <<a href="mailto:thakis@chromium.org">thakis@chromium.org</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"><div dir="ltr"><div dir="ltr"><div>Consider:</div><div><br></div><div>$ cat test.cc</div><div>#pragma GCC diagnostic warning "-Wsign-compare"</div><div><br></div><div>bool f(int a, unsigned b) {</div><div>  return a != b;</div><div>}</div><div>$ out/gn/bin/clang -c test.cc -Werror</div><div>test.cc:4:12: warning: comparison of integers of different signs: 'int' and 'unsigned int' [-Wsign-compare]</div><div>  return a != b;</div><div>         ~ ^  ~</div><div>1 warning generated.</div><div><br></div><div><br></div><div>I found it surprising that this is emitted as a warning, not as an error. If this is intentional, is there some other way to say "I want my compiler warnings to always be errors"?</div><div><br>Thanks,</div><div>Nico</div></div></div>
</blockquote></div>