Skip to content

release/22.x: [Sema] Fix format-strings test on AIX (#180566)#182755

Open
llvmbot wants to merge 1 commit intollvm:release/22.xfrom
llvmbot:issue180566
Open

release/22.x: [Sema] Fix format-strings test on AIX (#180566)#182755
llvmbot wants to merge 1 commit intollvm:release/22.xfrom
llvmbot:issue180566

Conversation

@llvmbot
Copy link
Copy Markdown
Member

@llvmbot llvmbot commented Feb 22, 2026

Backport 8f37bf6

Requested by: @amy-kwan

Simplify the conditional compilation and skip the problematic warnings
only on 32-bit Arm.

(cherry picked from commit 8f37bf6)
@llvmbot
Copy link
Copy Markdown
Member Author

llvmbot commented Feb 22, 2026

@azhan92 What do you think about merging this PR to the release branch?

@llvmbot llvmbot requested a review from azhan92 February 22, 2026 17:00
@llvmbot llvmbot added the clang Clang issues not falling into any other category label Feb 22, 2026
@llvmbot
Copy link
Copy Markdown
Member Author

llvmbot commented Feb 22, 2026

@llvm/pr-subscribers-clang

Author: None (llvmbot)

Changes

Backport 8f37bf6

Requested by: @amy-kwan


Full diff: https://github.com/llvm/llvm-project/pull/182755.diff

1 Files Affected:

  • (modified) clang/test/Sema/format-strings.c (+2-7)
diff --git a/clang/test/Sema/format-strings.c b/clang/test/Sema/format-strings.c
index 3a2c2701cfcfc..07bac7095ee82 100644
--- a/clang/test/Sema/format-strings.c
+++ b/clang/test/Sema/format-strings.c
@@ -3,12 +3,10 @@
 // RUN: %clang_cc1 -fblocks -fsyntax-only -verify -Wformat-nonliteral -isystem %S/Inputs -triple=x86_64-unknown-fuchsia %s
 // RUN: %clang_cc1 -fblocks -fsyntax-only -verify -Wformat-nonliteral -isystem %S/Inputs -triple=x86_64-linux-android %s
 
-#include <limits.h>
 #include <stdarg.h>
 #include <stddef.h>
 #define __need_wint_t
 #include <stddef.h> // For wint_t and wchar_t
-#include <stdint.h>
 
 typedef struct _FILE FILE;
 int fprintf(FILE *, const char *restrict, ...);
@@ -988,14 +986,11 @@ void test_promotion(void) {
 
 void test_bool(_Bool b, _Bool* bp)
 {
-#if SIZE_MAX != UINT_MAX
+#ifndef __arm__
   printf("%zu", b); // expected-warning-re{{format specifies type 'size_t' (aka '{{.+}}') but the argument has type '_Bool'}}
-#else
-  printf("%zu", b); // no-warning
-#endif
-#if PTRDIFF_MAX != INT_MAX
   printf("%td", b); // expected-warning-re{{format specifies type 'ptrdiff_t' (aka '{{.+}}') but the argument has type '_Bool'}}
 #else
+  printf("%zu", b); // no-warning
   printf("%td", b); // no-warning
 #endif
   printf("%jd", b); // expected-warning-re{{format specifies type 'intmax_t' (aka '{{.+}}') but the argument has type '_Bool'}}

Copy link
Copy Markdown
Member

@mgorny mgorny left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This change introduced regressions, see #180566 (comment)

@c-rhodes c-rhodes moved this from Needs Triage to Needs Fix in LLVM Release Status Feb 23, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

clang Clang issues not falling into any other category

Projects

Status: Needs Fix

Development

Successfully merging this pull request may close these issues.

4 participants