Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754211AbbLJWu6 (ORCPT ); Thu, 10 Dec 2015 17:50:58 -0500 Received: from mail-pf0-f174.google.com ([209.85.192.174]:36612 "EHLO mail-pf0-f174.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752288AbbLJWu5 (ORCPT ); Thu, 10 Dec 2015 17:50:57 -0500 Date: Thu, 10 Dec 2015 14:50:25 -0800 From: Kees Cook To: Shuah Khan Cc: linux-kernel@vger.kernel.org, alexandru.n.branciog@intel.com, adamse@google.com Subject: [PATCH] selftests/seccomp: fix 32-bit build warnings Message-ID: <20151210225025.GA14843@www.outflux.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The casting was done incorrectly for 32-bit builds. Fixed to use uintptr_t. Reported-by: Eric Adams Signed-off-by: Kees Cook --- tools/testing/selftests/seccomp/test_harness.h | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) 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); \ -- 2.6.3 -- Kees Cook Chrome OS & Brillo Security