[PATCH] D139737: [-Wunsafe-buffer-usage] Initiate Fix-it generation for local variable declarations

Jan Korous via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Thu Feb 2 19:11:03 PST 2023


jkorous added inline comments.


================
Comment at: clang/lib/Analysis/UnsafeBufferUsage.cpp:703
+      case Strategy::Kind::Span:
+        return FixItList{};
+      case Strategy::Kind::Wontfix:
----------------
I am afraid I might have found one more problem :(
I believe that for `span` strategy we have to make sure the index is > 0. Otherwise 
That means either an unsigned integer or signed or unsigned literal that is greater than 0.
For the literal you can take inspiration here:
https://reviews.llvm.org/D142795



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

https://reviews.llvm.org/D139737



More information about the cfe-commits mailing list