[clang] [Clang][Sema] Add fortify warnings for bcopy and bzero (#168965) (PR #186522)

Sharjeel Khan via cfe-commits cfe-commits at lists.llvm.org
Mon Apr 6 17:16:02 PDT 2026


================
@@ -508,7 +508,8 @@ void bcopy2 (void) {
   char src[] = {1, 2, 3, 4};
   char dst[1];
 
-  bcopy(src, dst, 4); // expected-warning{{overflow}}
+  bcopy(src, dst, 4); // expected-warning {{Memory copy function overflows the destination buffer}}
----------------
Sharjeel-Khan wrote:

Where does this "Memory copy function overflows the destination buffer" warning come from? Why does it not come in the bcopy in the other test file?

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


More information about the cfe-commits mailing list