Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

selftests: vDSO: parse_vdso: Test __SIZEOF_LONG__ instead of ULONG_MAX

According to limits.h(2) ULONG_MAX is only guaranteed to expand to an
expression, not a symbolic constant which can be evaluated by the
preprocessor.

Specifically the definition of ULONG_MAX from nolibc can not be evaluated
by the preprocessor. To provide compatibility with nolibc, check with
__SIZEOF_LONG__ instead, with is provided directly by the preprocessor
and therefore always a symbolic constant.

Signed-off-by: Thomas Weißschuh <thomas.weissschuh@linutronix.de>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Reviewed-by: Vincenzo Frascino <vincenzo.frascino@arm.com>
Acked-by: Shuah Khan <skhan@linuxfoundation.org>
Link: https://lore.kernel.org/all/20250226-parse_vdso-nolibc-v2-13-28e14e031ed8@linutronix.de

authored by

Thomas Weißschuh and committed by
Thomas Gleixner
032e8716 c9fbaa87

+1 -1
+1 -1
tools/testing/selftests/vDSO/parse_vdso.c
··· 26 26 27 27 /* And here's the code. */ 28 28 #ifndef ELF_BITS 29 - # if ULONG_MAX > 0xffffffffUL 29 + # if __SIZEOF_LONG__ >= 8 30 30 # define ELF_BITS 64 31 31 # else 32 32 # define ELF_BITS 32