[clang] [clang][test] Try to fix Sema/format-strings.c on i686 (PR #181800)
Timm Baeder via cfe-commits
cfe-commits at lists.llvm.org
Tue Feb 17 03:10:54 PST 2026
https://github.com/tbaederr created https://github.com/llvm/llvm-project/pull/181800
https://github.com/llvm/llvm-project/pull/180566 did this for 32bit arm, but this still breaks for us downstream on i686 with:
```
# .---command stderr------------
# | error: 'expected-warning' diagnostics expected but not seen:
# | File /builddir/build/BUILD/llvm-project/clang/test/Sema/format-strings.c Line 990: format specifies type 'size_t' (aka '{{.+}}') but the argument has type '_Bool'
# | File /builddir/build/BUILD/llvm-project/clang/test/Sema/format-strings.c Line 991: format specifies type 'ptrdiff_t' (aka '{{.+}}') but the argument has type '_Bool'
# | 2 errors generated.
# `-----------------------------
```
>From e3b24726d9a07927f3122252b927a739047236d3 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Timm=20B=C3=A4der?= <tbaeder at redhat.com>
Date: Tue, 17 Feb 2026 12:05:34 +0100
Subject: [PATCH] [clang][test] Try to fix Sema/format-strings.c on i686
https://github.com/llvm/llvm-project/pull/180566 did this for 32bit arm,
but this still breaks for us downstream on i686 with:
```
```
---
clang/test/Sema/format-strings.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/clang/test/Sema/format-strings.c b/clang/test/Sema/format-strings.c
index 07bac7095ee82..96159afefebd7 100644
--- a/clang/test/Sema/format-strings.c
+++ b/clang/test/Sema/format-strings.c
@@ -986,7 +986,7 @@ void test_promotion(void) {
void test_bool(_Bool b, _Bool* bp)
{
-#ifndef __arm__
+#ifdef __LP64__
printf("%zu", b); // expected-warning-re{{format specifies type 'size_t' (aka '{{.+}}') but the argument has type '_Bool'}}
printf("%td", b); // expected-warning-re{{format specifies type 'ptrdiff_t' (aka '{{.+}}') but the argument has type '_Bool'}}
#else
More information about the cfe-commits
mailing list