[clang] [-Wunsafe-buffer-usage] Suppress warning for multi-dimensional constant arrays (PR #118249)

Malavika Samak via cfe-commits cfe-commits at lists.llvm.org
Thu Dec 5 21:51:59 PST 2024


================
@@ -8,6 +8,5 @@
 // main function
 int main(int argc, char *argv[]) { // expected-warning{{'argv' is an unsafe pointer used for buffer access}}
   char tmp;
-  tmp = argv[5][5];                // expected-note{{used in buffer access here}} \
-				      expected-warning{{unsafe buffer access}}
----------------
malavikasamak wrote:

Yes. That is doable. I can just take out the part that associates the operations to DREs for 2-D array accesses. Perhaps we should file a radar to claim operations that are clearly associated with DREs?

https://github.com/llvm/llvm-project/pull/118249


More information about the cfe-commits mailing list