[PATCH] D122983: [C11/C2x] Change the behavior of the implicit function declaration warning

Hubert Tong via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Tue Apr 5 07:47:51 PDT 2022

hubert.reinterpretcast added a comment.

In D122983#3429060 <https://reviews.llvm.org/D122983#3429060>, @aaron.ballman wrote:

> Morally, yes, that's reasonable in CodeGen because you're ensuring you get no diagnostics. Practically, that's a convoluted, more expensive, less maintainable way to spell `-Werror` for the test. When diagnostics are introduced, this pattern encourages people to remove the `// expected-no-diagnostics` comment and start adding `// expected-warning {{}}` comments. Running the diagnostic verifier also slows down test execution because of the extra verification step (which adds up over thousands of tests).

Thanks for the tip. I never thought to use `-Werror` that way.



More information about the cfe-commits mailing list