Received: by 10.223.164.202 with SMTP id h10csp847413wrb; Mon, 6 Nov 2017 17:14:59 -0800 (PST) X-Google-Smtp-Source: ABhQp+S5k+OURVSSD3A8f/kGc1LMd8oCMJ0V8fI6E52DoYg8I6fqHNOj/wHe2e/YKtN0OyhpKlxi X-Received: by 10.99.99.65 with SMTP id x62mr17145121pgb.221.1510017299732; Mon, 06 Nov 2017 17:14:59 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1510017299; cv=none; d=google.com; s=arc-20160816; b=g1QmnIFaOzSYuIkTC+Vc7d5AZgc6fUqBsBPyX2Lzw4YChUsHU4LH2DRK8FZ0zcfBBM dovXB2EGgn0WB7lA24vpqJlzNuijWDGIS6rFz3oz3wLeVXJyFrFOxSrVsUpKLTEMWkix FBjIeOECTMfsFF7K/+7b3IvYbDySd/4WZAlMpWUSnlwZ8W87v+9VGu1nE/9gASU2KjGp VtX6H8M+Kv/m4Z4NlISlWzZ1bPMV57o+kJh+tkoSLJdXbVQzPKmS/vVjLJZXuOhcspI5 uNU0oI2kRjJr8zIVwPNmgRNmzUS4QhNq8azNT/yVKy7VK0f5I3ETZ9oNu1xC976K582j NrrA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:in-reply-to :mime-version:user-agent:date:message-id:from:cc:references:to :subject:arc-authentication-results; bh=EPEdz2xNSDmpvRUou3jyu8BgxaWQu/SxV6jQDLaEMd4=; b=DZq/fhmknXLrx4rRY70YRXJ7aaGL6yNWBgddUMnuFUPIdPYM4IE9MZgOuM9Npg6SpX BpDmdoP+ll5i0AI+wHY75vA6BqEaQV3X+dEuZOMjIUXfFMZECdw8/k4mfx19ABMTrAVn 0L/3xpbOaT6RboIj71fTVu2/Sp1tfKYFipSIdq5T3l4tmGaSZ4DYClevTaUzi5l9zya0 48zH3uNudXUKYfaBr9WPeLVhoVibeju4xShAvfeeqAfPh1bxwQjaL6pG5flxF5kmsGFP fwGFQ7Jr+EHvK50FCLTNz/XSdlyw/qrVu1J3LSoSCcvyVeIhDvmKhSE6of6vSK1yBBpn IbjA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id o11si475pgs.552.2017.11.06.17.14.46; Mon, 06 Nov 2017 17:14:59 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755778AbdKGBMb (ORCPT + 94 others); Mon, 6 Nov 2017 20:12:31 -0500 Received: from mail5.windriver.com ([192.103.53.11]:38374 "EHLO mail5.wrs.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752717AbdKGBM2 (ORCPT ); Mon, 6 Nov 2017 20:12:28 -0500 Received: from ALA-HCA.corp.ad.wrs.com (ala-hca.corp.ad.wrs.com [147.11.189.40]) by mail5.wrs.com (8.15.2/8.15.2) with ESMTPS id vA71CPJr021961 (version=TLSv1 cipher=AES128-SHA bits=128 verify=OK); Mon, 6 Nov 2017 17:12:25 -0800 Received: from [128.224.163.162] (128.224.163.162) by ALA-HCA.corp.ad.wrs.com (147.11.189.50) with Microsoft SMTP Server (TLS) id 14.3.361.1; Mon, 6 Nov 2017 17:12:25 -0800 Subject: Re: [PATCH] selftests: memfd_test.c: fix compilation warning. To: Shuah Khan References: <1509879400-26061-1-git-send-email-Lei.Yang@windriver.com> <6a76f65a-a484-ba72-6cc5-85010666359c@osg.samsung.com> CC: , , Shuah Khan From: lei yang Message-ID: <52f83b6e-0472-bf5b-6a00-571c56b6732d@windriver.com> Date: Tue, 7 Nov 2017 09:11:59 +0800 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.5.1 MIME-Version: 1.0 In-Reply-To: <6a76f65a-a484-ba72-6cc5-85010666359c@osg.samsung.com> Content-Type: text/plain; charset="utf-8"; format=flowed Content-Transfer-Encoding: 8bit X-Originating-IP: [128.224.163.162] Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 2017年11月07日 07:46, Shuah Khan wrote: > On 11/05/2017 03:56 AM, Lei Yang wrote: >> Replace '%d' by '%zu' to fix the following compilation warning. >> >> memfd_test.c:517:3: warning: format ‘%d’ expects argument of >> type ‘int’,but argument 2 has type ‘size_t’ [-Wformat=] >> printf("malloc(%d) failed: %m\n", mfd_def_size * 8); >> ^ >> memfd_test.c: In function ‘mfd_fail_grow_write’: >> memfd_test.c:537:3: warning: format ‘%d’ expects argument >> of type ‘int’,but argument 2 has type ‘size_t’ [-Wformat=] >> printf("malloc(%d) failed: %m\n", mfd_def_size * 8); >> >> Signed-off-by: Lei Yang >> --- >> tools/testing/selftests/memfd/memfd_test.c | 4 ++-- >> 1 file changed, 2 insertions(+), 2 deletions(-) >> >> diff --git a/tools/testing/selftests/memfd/memfd_test.c b/tools/testing/selftests/memfd/memfd_test.c >> index f94c6d1..95df9e6 100644 >> --- a/tools/testing/selftests/memfd/memfd_test.c >> +++ b/tools/testing/selftests/memfd/memfd_test.c >> @@ -514,7 +514,7 @@ static void mfd_assert_grow_write(int fd) >> >> buf = malloc(mfd_def_size * 8); >> if (!buf) { >> - printf("malloc(%d) failed: %m\n", mfd_def_size * 8); >> + printf("malloc(%zu) failed: %m\n", mfd_def_size * 8); >> abort(); >> } >> >> @@ -534,7 +534,7 @@ static void mfd_fail_grow_write(int fd) >> >> buf = malloc(mfd_def_size * 8); >> if (!buf) { >> - printf("malloc(%d) failed: %m\n", mfd_def_size * 8); >> + printf("malloc(%zu) failed: %m\n", mfd_def_size * 8); >> abort(); >> } >> >> > Relates to gcc version perhaps. What's your gcc version? $ cat /proc/version Linux version 3.16.0-30-generic (buildd@kissel) (gcc version 4.8.2 (Ubuntu 4.8.2-19ubuntu1) ) #40~14.04.1-Ubuntu SMP Thu Jan 15 17:43:14 UTC 2015 Lei > thanks, > -- Shuah From 1583362456670168755@xxx Mon Nov 06 23:48:28 +0000 2017 X-GM-THRID: 1583223412588596189 X-Gmail-Labels: Inbox,Category Forums,HistoricalUnread