Received: by 10.223.164.202 with SMTP id h10csp785096wrb; Mon, 6 Nov 2017 15:48:28 -0800 (PST) X-Google-Smtp-Source: ABhQp+RHqd5K+/SP7FQ+n+fYnxFdohRkrIH5NXz46cuKp4c6+HQBxmXfGSY7szHpQfGy8j3evDCW X-Received: by 10.159.229.136 with SMTP id az8mr16208259plb.423.1510012108827; Mon, 06 Nov 2017 15:48:28 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1510012108; cv=none; d=google.com; s=arc-20160816; b=aJglyZ0fHlOISX3WiTu2GZ3pwTJ/MKfr554rSL591lXJKIRkdujgrSK7M5H2EF6Z3J 3+peSaVBmqhfcoV+pDQWAEkArF8hPwgwn10OR/9hVtiMo11qDGOqPcKUbe+r1L80Azrr G32b0F3cALUNglKUi5zweu02HsVKdsJH0lKCriEILbn8CaOsfE+CCAkbJV7F7MKo/n+1 yfsOsoaulUfozTJDmhlkWlUtH0WYfM/XFVy/GeTvkW4Z6ui5B9qUtO+NPFgammP9LeVP 8Gx4EaSNFfKSdxGPMA7T3fyugh+ewPL/vRDG/6NEhsZvwNJ7MJwT9JdCebdCOkKBnMHv f86w== 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 :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:cc:references:to:subject:arc-authentication-results; bh=8xEZ40ZIesusGhn4PUaVTgVIeZlyJk+zHwdA1kvXvSY=; b=P3Hfx8/roSm8pPvAx2S8kltCzPjGr9D4SF/QLKUE1iavwxuMjBQJNAF/jzTWY9iD5L 3LVCRePlk8/41ctNFyXds0d29OMyYdIPsabLvx9D9T8AJl7bP/hdCjyZiQgBb+c7dC/j cg82Bz2hgP7eb2lvKKUj7ZF9o/f8AcYSOLsSq4Pfrcw+QH37mZYWyHckNGLZmUj9y/BQ QBb5wlUrWwoMJbKPTQCLkr2rCCMR54/nbhyQ8TqYvxap8d290dSNHEiooGUz8xHiUO9f x7oswc4TEhFplBuQbvd++IVjUaCjKP+DWTwB8IT5w+mGkj9JMoWif6lGSiaPE47VGL5Q 4ntg== 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=samsung.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id z20si12857405pfe.221.2017.11.06.15.48.15; Mon, 06 Nov 2017 15:48:28 -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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=samsung.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754856AbdKFXq6 (ORCPT + 94 others); Mon, 6 Nov 2017 18:46:58 -0500 Received: from osg.samsung.com ([64.30.133.232]:42096 "EHLO osg.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754615AbdKFXq4 (ORCPT ); Mon, 6 Nov 2017 18:46:56 -0500 Received: from localhost (localhost [127.0.0.1]) by osg.samsung.com (Postfix) with ESMTP id B93FC24284; Mon, 6 Nov 2017 15:46:55 -0800 (PST) X-Virus-Scanned: Debian amavisd-new at dev.s-opensource.com Received: from osg.samsung.com ([127.0.0.1]) by localhost (localhost [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id mPWDyyrtU-SB; Mon, 6 Nov 2017 15:46:54 -0800 (PST) Received: from [192.168.1.87] (c-24-9-64-241.hsd1.co.comcast.net [24.9.64.241]) by osg.samsung.com (Postfix) with ESMTPSA id 477B724279; Mon, 6 Nov 2017 15:46:54 -0800 (PST) Subject: Re: [PATCH] selftests: memfd_test.c: fix compilation warning. To: Lei Yang References: <1509879400-26061-1-git-send-email-Lei.Yang@windriver.com> Cc: linux-kselftest@vger.kernel.org, linux-kernel@vger.kernel.org, Shuah Khan , Shuah Khan From: Shuah Khan Message-ID: <6a76f65a-a484-ba72-6cc5-85010666359c@osg.samsung.com> Date: Mon, 6 Nov 2017 16:46:53 -0700 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.4.0 MIME-Version: 1.0 In-Reply-To: <1509879400-26061-1-git-send-email-Lei.Yang@windriver.com> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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? thanks, -- Shuah From 1583223412588596189@xxx Sun Nov 05 10:58:25 +0000 2017 X-GM-THRID: 1583223412588596189 X-Gmail-Labels: Inbox,Category Forums,HistoricalUnread