Skip to content

Commit 032e871

Browse files
t-8chKAGA-KOKO
authored andcommitted
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 <[email protected]> Signed-off-by: Thomas Gleixner <[email protected]> Reviewed-by: Vincenzo Frascino <[email protected]> Acked-by: Shuah Khan <[email protected]> Link: https://lore.kernel.org/all/[email protected]
1 parent c9fbaa8 commit 032e871

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

tools/testing/selftests/vDSO/parse_vdso.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626

2727
/* And here's the code. */
2828
#ifndef ELF_BITS
29-
# if ULONG_MAX > 0xffffffffUL
29+
# if __SIZEOF_LONG__ >= 8
3030
# define ELF_BITS 64
3131
# else
3232
# define ELF_BITS 32

0 commit comments

Comments
 (0)