sys/sys: Fix __builtin_is_aligned fallback

When the compiler doesn't provide __builtin_is_aligned we use
macro as a fallback. The macro was missing brackets around one
argument. This could lead to incorrect results when the argument is
more complex than a single stagement.

Fix this by adding the needed brackets.

Reviewed by:	brooks, imp, jhb
Sponsored by:	Arm Ltd
Differential Revision:	https://reviews.freebsd.org/D45260

(cherry picked from commit 940155d24a)
This commit is contained in:
Andrew Turner 2024-05-22 08:18:26 +00:00
parent 71f04a3609
commit e63ac0eb58

View file

@ -913,7 +913,7 @@
/* Provide fallback versions for other compilers (GCC/Clang < 10): */
#if !__has_builtin(__builtin_is_aligned)
#define __builtin_is_aligned(x, align) \
(((__uintptr_t)x & ((align) - 1)) == 0)
(((__uintptr_t)(x) & ((align) - 1)) == 0)
#endif
#if !__has_builtin(__builtin_align_up)
#define __builtin_align_up(x, align) \