[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
Wed Apr 28 13:57:08 PDT 2021


mbenfield added a comment.

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

> 



> Yes, the best solution. Also consider to check gcc’s test-suite - if they have this type of testcase, then this is wanted behaviour.

gcc has `Wunused-var-5.c`, where the warning `-Wunused-but-set-variable` is applied but

  void bar (int, ...);
  void f18 (void) { _Atomic int x = 0; int y = 3; bar (x = y); }

is not expected to trigger the warning, which does seem to imply this is intentional.


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