[PATCH] stdbit: Fix builtin name used in __glibc_has_builtin check for rotate_right

Uros Bizjak ubizjak@gmail.com
Wed May 6 11:03:03 GMT 2026


The __glibc_has_builtin check in include/stdbit.h incorrectly refers to
___builtin_stdc_rotate_right (with three leading underscores) instead of the
correct __builtin_stdc_rotate_right (two leading underscores). As a result,
the builtin is not detected even when supported by the compiler.

Fix the spelling to use __builtin_stdc_rotate_right consistently in both the
feature test and the corresponding comment.

Fixes: 4adae8550a7a ("stdlib: Add internal stdc_rotate_right implementation")
Cc: Adhemerval Zanella <adhemerval.zanella@linaro.org>
Signed-off-by: Uros Bizjak <ubizjak@gmail.com>
---
 include/stdbit.h | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/include/stdbit.h b/include/stdbit.h
index 5be19b882e..863b0f8383 100644
--- a/include/stdbit.h
+++ b/include/stdbit.h
@@ -5,8 +5,8 @@
 #ifndef _ISOMAC
 # include <stdint.h>
 
-#  if __glibc_has_builtin (___builtin_stdc_rotate_right)
-#   define stdc_rotate_right(__x, __n) (___builtin_stdc_rotate_right (__x, __n))
+#  if __glibc_has_builtin (__builtin_stdc_rotate_right)
+#   define stdc_rotate_right(__x, __n) (__builtin_stdc_rotate_right (__x, __n))
 #   define stdc_rotate_right_uc(__x, __n) (stdc_rotate_right (__x, __n))
 #   define stdc_rotate_right_us(__x, __n) (stdc_rotate_right (__x, __n))
 #   define stdc_rotate_right_ui(__x, __n) (stdc_rotate_right (__x, __n))
@@ -62,7 +62,7 @@ __ror64_inline (uint64_t __x, unsigned int __n)
 #    define stdc_rotate_right_ul(__x, __n) (__ror32_inline (__x, __n))
 #   endif
 #   define stdc_rotate_right_ull(__x, __n) (__ror64_inline (__x, __n))
-#  endif /* __glibc_has_builtin (___builtin_stdc_rotate_right) */
+#  endif /* __glibc_has_builtin (__builtin_stdc_rotate_right) */
 
 # endif /* _ISOMAC */
 
-- 
2.54.0



More information about the Libc-alpha mailing list