[PATCH] D144064: [-Wunsafe-buffer-usage] Match unsafe pointers being casted to bool or participating in pointer subtractions

Malavika Samak via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Wed Mar 8 11:55:31 PST 2023


malavikasamak added inline comments.


================
Comment at: clang/lib/Analysis/UnsafeBufferUsage.cpp:156
+  // 2. the operand of a cast-to-(Integer or Boolean) operation; or
+  // 3. the operand of a pointer subtraction operation; or
+  // 4. the operand of a pointer comparison operation; or
----------------
I don't understand why we are special handling only pointer subtraction here. Won't pointer addition be also considered UPC? If so, can we just add it to this patch.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D144064



More information about the cfe-commits mailing list