[clang] [analyzer] Fix 'bstring.c' test on Mingw (PR #192252)
via cfe-commits
cfe-commits at lists.llvm.org
Wed Apr 15 05:49:47 PDT 2026
llvmbot wrote:
<!--LLVM PR SUMMARY COMMENT-->
@llvm/pr-subscribers-clang
Author: Balázs Benics (steakhal)
<details>
<summary>Changes</summary>
We can't just `_WIN32` macro because it's not present on Mingw.
Addresses https://github.com/llvm/llvm-project/pull/191061#issuecomment-4250948488
Co-authored-by: Martin Storsjö <martin@<!-- -->martin.st>
---
Full diff: https://github.com/llvm/llvm-project/pull/192252.diff
1 Files Affected:
- (modified) clang/test/Analysis/bstring.c (+1-1)
``````````diff
diff --git a/clang/test/Analysis/bstring.c b/clang/test/Analysis/bstring.c
index f343aaec43307..7e2ee1af006af 100644
--- a/clang/test/Analysis/bstring.c
+++ b/clang/test/Analysis/bstring.c
@@ -539,7 +539,7 @@ void nocrash_on_locint_offset(void *addr, void* from, struct S s) {
void nocrash_on_empty_struct_memcpy(void) {
struct {} a[10];
__builtin_memcpy(&a[2], a, 2); // no-crash
-#if !defined(_WIN32)
+#if defined(__GNUC__)
// expected-warning at -2 {{'memcpy' will always overflow; destination buffer has size 0, but size argument is 2}}
// expected-warning at -3 {{Memory copy function overflows the destination buffer}}
#endif
``````````
</details>
https://github.com/llvm/llvm-project/pull/192252
More information about the cfe-commits
mailing list