Skip to content

Conversation

lntue
Copy link
Contributor

@lntue lntue commented Sep 22, 2025

No description provided.

@llvmbot
Copy link
Member

llvmbot commented Sep 22, 2025

@llvm/pr-subscribers-libc

Author: None (lntue)

Changes

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

1 Files Affected:

  • (modified) libc/test/include/stdbit_stub.h (+30-20)
diff --git a/libc/test/include/stdbit_stub.h b/libc/test/include/stdbit_stub.h
index e08c86271332e..4ca26b6d81d82 100644
--- a/libc/test/include/stdbit_stub.h
+++ b/libc/test/include/stdbit_stub.h
@@ -17,19 +17,19 @@
 #include <stdbool.h> // bool in C
 
 #define STDBIT_STUB_FUNCTION(FUNC_NAME, LEADING_VAL)                           \
-  unsigned FUNC_NAME##_uc([[maybe_unused]] unsigned char x) {                  \
+  unsigned FUNC_NAME##_uc(unsigned char __attribute__((unused)) x) {           \
     return LEADING_VAL##AU;                                                    \
   }                                                                            \
-  unsigned FUNC_NAME##_us([[maybe_unused]] unsigned short x) {                 \
+  unsigned FUNC_NAME##_us(unsigned short __attribute__((unused)) x) {          \
     return LEADING_VAL##BU;                                                    \
   }                                                                            \
-  unsigned FUNC_NAME##_ui([[maybe_unused]] unsigned int x) {                   \
+  unsigned FUNC_NAME##_ui(unsigned int __attribute__((unused)) x) {            \
     return LEADING_VAL##CU;                                                    \
   }                                                                            \
-  unsigned FUNC_NAME##_ul([[maybe_unused]] unsigned long x) {                  \
+  unsigned FUNC_NAME##_ul(unsigned long __attribute__((unused)) x) {           \
     return LEADING_VAL##DU;                                                    \
   }                                                                            \
-  unsigned FUNC_NAME##_ull([[maybe_unused]] unsigned long long x) {            \
+  unsigned FUNC_NAME##_ull(unsigned long long __attribute__((unused)) x) {     \
     return LEADING_VAL##EU;                                                    \
   }
 
@@ -46,41 +46,51 @@ STDBIT_STUB_FUNCTION(stdc_first_trailing_one, 0x1)
 STDBIT_STUB_FUNCTION(stdc_count_zeros, 0x2)
 STDBIT_STUB_FUNCTION(stdc_count_ones, 0x3)
 
-bool stdc_has_single_bit_uc([[maybe_unused]] unsigned char x) { return false; }
-bool stdc_has_single_bit_us([[maybe_unused]] unsigned short x) { return false; }
-bool stdc_has_single_bit_ui([[maybe_unused]] unsigned x) { return false; }
-bool stdc_has_single_bit_ul([[maybe_unused]] unsigned long x) { return false; }
-bool stdc_has_single_bit_ull([[maybe_unused]] unsigned long long x) {
+bool stdc_has_single_bit_uc(unsigned char __attribute__((unused)) x) {
+  return false;
+}
+bool stdc_has_single_bit_us(unsigned short __attribute__((unused)) x) {
+  return false;
+}
+bool stdc_has_single_bit_ui(unsigned __attribute__((unused)) x) {
+  return false;
+}
+bool stdc_has_single_bit_ul(unsigned long __attribute__((unused)) x) {
+  return false;
+}
+bool stdc_has_single_bit_ull(unsigned long long __attribute__((unused)) x) {
   return false;
 }
 
 STDBIT_STUB_FUNCTION(stdc_bit_width, 0x4)
 
-unsigned char stdc_bit_floor_uc([[maybe_unused]] unsigned char x) {
+unsigned char stdc_bit_floor_uc(unsigned char __attribute__((unused)) x) {
   return 0x5AU;
 }
-unsigned short stdc_bit_floor_us([[maybe_unused]] unsigned short x) {
+unsigned short stdc_bit_floor_us(unsigned short __attribute__((unused)) x) {
   return 0x5BU;
 }
-unsigned stdc_bit_floor_ui([[maybe_unused]] unsigned x) { return 0x5CU; }
-unsigned long stdc_bit_floor_ul([[maybe_unused]] unsigned long x) {
+unsigned stdc_bit_floor_ui(unsigned __attribute__((unused)) x) { return 0x5CU; }
+unsigned long stdc_bit_floor_ul(unsigned long __attribute__((unused)) x) {
   return 0x5DUL;
 }
-unsigned long long stdc_bit_floor_ull([[maybe_unused]] unsigned long long x) {
+unsigned long long stdc_bit_floor_ull(unsigned long long
+                                      __attribute__((unused)) x) {
   return 0x5EULL;
 }
 
-unsigned char stdc_bit_ceil_uc([[maybe_unused]] unsigned char x) {
+unsigned char stdc_bit_ceil_uc(unsigned char __attribute__((unused)) x) {
   return 0x6AU;
 }
-unsigned short stdc_bit_ceil_us([[maybe_unused]] unsigned short x) {
+unsigned short stdc_bit_ceil_us(unsigned short __attribute__((unused)) x) {
   return 0x6BU;
 }
-unsigned stdc_bit_ceil_ui([[maybe_unused]] unsigned x) { return 0x6CU; }
-unsigned long stdc_bit_ceil_ul([[maybe_unused]] unsigned long x) {
+unsigned stdc_bit_ceil_ui(unsigned __attribute__((unused)) x) { return 0x6CU; }
+unsigned long stdc_bit_ceil_ul(unsigned long __attribute__((unused)) x) {
   return 0x6DUL;
 }
-unsigned long long stdc_bit_ceil_ull([[maybe_unused]] unsigned long long x) {
+unsigned long long stdc_bit_ceil_ull(unsigned long long
+                                     __attribute__((unused)) x) {
   return 0x6EULL;
 }
 

@lntue lntue enabled auto-merge (squash) September 22, 2025 17:47
@lntue lntue merged commit e361c0f into llvm:main Sep 22, 2025
21 checks passed
@lntue lntue deleted the build_fix branch September 22, 2025 17:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants