[libcxx-commits] [clang] [compiler-rt] [libcxx] [clang] Add unistd fortify checks and analyzer size constraints (PR #196499)

Oliver Hunt via libcxx-commits libcxx-commits at lists.llvm.org
Tue May 12 00:42:57 PDT 2026


================
@@ -536,7 +536,8 @@ int f262(void) {
   struct aa a262 = {{1, 2, 3, 4}, 0};
   a262.s2 = strdup("hello");
   char input[] = {'a', 'b', 'c', 'd'};
-  memcpy(a262.s1, input, -1); // expected-warning{{'memcpy' will always overflow; destination buffer has size 16, but size argument is 18446744073709551615}}
+  memcpy(a262.s1, input, -1); // expected-warning{{'memcpy' will always overflow; destination buffer has size 16, but size argument is 18446744073709551615}} \
----------------
ojhunt wrote:

don't do this, just use expected-warning at -1

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


More information about the libcxx-commits mailing list