git: 5faceb84142f - main - __builtin_align_down: Cast value to __uintptr_t in the fallback
- Go to: [ bottom of page ] [ top of archives ] [ this month ]
Date: Tue, 24 Feb 2026 20:24:28 UTC
The branch main has been updated by jhb:
URL: https://cgit.FreeBSD.org/src/commit/?id=5faceb84142f3c9886f38a03dd5214785ac6961f
commit 5faceb84142f3c9886f38a03dd5214785ac6961f
Author: John Baldwin <jhb@FreeBSD.org>
AuthorDate: 2026-02-24 20:24:17 +0000
Commit: John Baldwin <jhb@FreeBSD.org>
CommitDate: 2026-02-24 20:24:17 +0000
__builtin_align_down: Cast value to __uintptr_t in the fallback
This matches the behavior of the fallbacks for __builtin_align_up
and __builtin_is_aligned.
Reviewed by: arichardson, ngie, kib
Differential Revision: https://reviews.freebsd.org/D55161
---
sys/sys/cdefs.h | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/sys/sys/cdefs.h b/sys/sys/cdefs.h
index ea6a92ad0056..132d4809b0ed 100644
--- a/sys/sys/cdefs.h
+++ b/sys/sys/cdefs.h
@@ -649,7 +649,7 @@
#endif
#if !__has_builtin(__builtin_align_down)
#define __builtin_align_down(x, align) \
- ((__typeof__(x))((x)&(~((align)-1))))
+ ((__typeof__(x))((__uintptr_t)(x)&(~((align)-1))))
#endif
#define __align_up(x, y) __builtin_align_up(x, y)