[PATCH] D100581: [Clang] -Wunused-but-set-parameter and -Wunused-but-set-variable
Dávid Bolvanský via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Mon Apr 19 12:31:57 PDT 2021
xbolva00 added a subscriber: rsmith.
xbolva00 added a comment.
In D100581#2697697 <https://reviews.llvm.org/D100581#2697697>, @mbenfield wrote:
> 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`.
I am a little bit worried that another off by default warning is not ideal from user point of view. Either the user simply would fail to find out that there is a new option or will be surprised that gcc fires and clang does not even when we claim we implemented this “gcc’s” warning.
About your points, @rsmith may help you.
-
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