[clang] [-Wunsafe-buffer-usage] Introduce std::array fixits (PR #80084)

Artem Dergachev via cfe-commits cfe-commits at lists.llvm.org
Thu Feb 1 14:15:49 PST 2024


================
@@ -61,6 +61,7 @@ void testArraySubscripts(int *p, int **pp) {
       );
 
     int a[10];          // expected-warning{{'a' is an unsafe buffer that does not perform bounds checks}}
+                        // expected-note at -1{{change type of 'a' to 'std::array' to harden it}}
----------------
haoNoQ wrote:

I think it's important to make sure it's not actively misleading, even if we plan to figure out the perfect phrasing later.  Maybe `to incapsulate it for hardening purposes`?

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


More information about the cfe-commits mailing list