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

David Blaikie via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Thu Apr 29 16:12:47 PDT 2021


dblaikie added a comment.

In D100581#2727330 <https://reviews.llvm.org/D100581#2727330>, @mbenfield wrote:

> Another try at these warnings, using the implementation strategy outlined by rsmith.
>
> A couple other notes:
>
> - At the moment I've removed these warnings from the diagnostic groups -Wextra and -Wunused. It was suggested by aeubanks that the groups could be added in a later commit, once these warnings have been determined to not be too disruptive. Of course I can change this now if requested.
>
> - I've just tried to mimic gcc's behavior as closely as possible, including not warning if an assignment is used, and not warning on nonscalar types in C++ (except that in some cases gcc inexplicably does warn on nonscalar types; test on the file vector-gcc-compat.c to compare... I haven't determined any rationale to when it chooses to warn in these cases).

Got a link/examples of cases GCC does and doesn't warn about? I'd assume it'd have something to do with the triviality or non-triviality of certain operations of the nonscalar types (eg: is the type trivially assignable/trivially destructible)


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