[PATCH] D100581: [Clang] -Wunused-but-set-parameter and -Wunused-but-set-variable

Michael Benfield via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Sun Apr 18 20:44:39 PDT 2021


mbenfield added a comment.

In D100581#2693131 <https://reviews.llvm.org/D100581#2693131>, @xbolva00 wrote:

>>> These warnings are not enabled by any other flags. This is different from gcc, where -Wunused-but-set-variable is enabled by -Wextra in combination with either -Wunused or -Wall.
>
> IMHO we should follow gcc here.

I'd be happy to do so, but there are two issues:

1. I'm not sure this is feasible and fits in with how Clang's diagnostics are organized. AFAICT clang's diagnostics are not set up to have a diagnostic enabled only if //two// other flags are set. If I'm wrong please let me know.

2. In gcc, this is how `-Wunused-parameter` behaves, but clang's `-Wunused-parameter` is already different. In clang, it's enabled by `-Wextra` regardless of `-Wall` or `-Wunused`.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D100581/new/

https://reviews.llvm.org/D100581



More information about the cfe-commits mailing list