yonghong-song added inline comments.

================
Comment at: clang/test/Sema/warn-unused-but-set-variables.c:66
+  for (int i = 0; i < 1000; i++)
+    j += 1;
+  return;
----------------
efriedma wrote:
> The handling of this testcase without your patch seems fine.  Even if the 
> value of j is technically read, it's not "used" in any meaningful way.
> 
> I think the distinguishing factor for the testcase we discussed before is the 
> use of a "volatile".  Volatile is rare, and indicates the user is 
> intentionally doing something unusual, so it probably doesn't make sense to 
> warn.
@eli.friedman Just updated the patch to handle volatile variable only.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D121715

_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to