From: Kees Cook Date: Thu, 10 Dec 2015 22:50:25 +0000 (-0800) Subject: selftests/seccomp: fix 32-bit build warnings X-Git-Tag: v4.5-rc1~75^2~5 X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=b5bb6d3068eabb075ee7db09c73374f6db73ff4a;p=karo-tx-linux.git selftests/seccomp: fix 32-bit build warnings The casting was done incorrectly for 32-bit builds. Fixed to use uintptr_t. Reported-by: Eric Adams Signed-off-by: Kees Cook Signed-off-by: Shuah Khan --- diff --git a/tools/testing/selftests/seccomp/test_harness.h b/tools/testing/selftests/seccomp/test_harness.h index fb2841601f2f..a786c69c7584 100644 --- a/tools/testing/selftests/seccomp/test_harness.h +++ b/tools/testing/selftests/seccomp/test_harness.h @@ -42,6 +42,7 @@ #define TEST_HARNESS_H_ #define _GNU_SOURCE +#include #include #include #include @@ -370,8 +371,8 @@ __typeof__(_expected) __exp = (_expected); \ __typeof__(_seen) __seen = (_seen); \ if (!(__exp _t __seen)) { \ - unsigned long long __exp_print = (unsigned long long)__exp; \ - unsigned long long __seen_print = (unsigned long long)__seen; \ + unsigned long long __exp_print = (uintptr_t)__exp; \ + unsigned long long __seen_print = (uintptr_t)__seen; \ __TH_LOG("Expected %s (%llu) %s %s (%llu)", \ #_expected, __exp_print, #_t, \ #_seen, __seen_print); \