From patchwork Wed Aug 7 13:09:02 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Ren=C3=A9_Scharfe?= X-Patchwork-Id: 11082139 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 6E6D11395 for ; Wed, 7 Aug 2019 13:09:18 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 5E2ED28A32 for ; Wed, 7 Aug 2019 13:09:18 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 51B8E28A33; Wed, 7 Aug 2019 13:09:18 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.7 required=2.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,FREEMAIL_FROM,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id D818F28421 for ; Wed, 7 Aug 2019 13:09:07 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2387981AbfHGNJH (ORCPT ); Wed, 7 Aug 2019 09:09:07 -0400 Received: from mout.web.de ([212.227.15.4]:49231 "EHLO mout.web.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726873AbfHGNJG (ORCPT ); Wed, 7 Aug 2019 09:09:06 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=web.de; s=dbaedf251592; t=1565183342; bh=5syvMQWVIsQaCmRocbkSA2sBjepuQEoaCbOQfmTI8Wg=; h=X-UI-Sender-Class:Subject:From:To:Cc:References:Date:In-Reply-To; b=qV3N1Kg6EBvv5Bke1+S446Ne3hx85Ec5A8gQbUfTa/g4WOaHbk7TwyOjSp71YfWff n+3lUGL0GVqM2o3owXBodI5O18YGWfEkd95aixz4XBz/HfQhb1EUjNj2qJsvFa4iQY g0/938rncujLmRIoHjL5HbZyOtcbEviP3whE6uFA= X-UI-Sender-Class: c548c8c5-30a9-4db5-a2e7-cb6cb037b8f9 Received: from [192.168.178.23] ([79.203.24.71]) by smtp.web.de (mrweb003 [213.165.67.108]) with ESMTPSA (Nemesis) id 0MCZfe-1i3dPQ2dAg-009SEE; Wed, 07 Aug 2019 15:09:02 +0200 Subject: [PATCH 2/2] nedmalloc: avoid compiler warning about unused value From: =?utf-8?q?Ren=C3=A9_Scharfe?= To: Carlo Arenas Cc: git@vger.kernel.org, gitster@pobox.com, johannes.schindelin@gmx.de, avarab@gmail.com, michal.kiedrowicz@gmail.com References: <20190806085014.47776-1-carenas@gmail.com> <20190806163658.66932-1-carenas@gmail.com> <20190806163658.66932-3-carenas@gmail.com> Message-ID: <5933e4d2-8141-efd9-9ed4-76946a84974b@web.de> Date: Wed, 7 Aug 2019 15:09:02 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.8.0 MIME-Version: 1.0 In-Reply-To: Content-Language: en-US X-Provags-ID: V03:K1:ik0G8RVWw3b/wCo6ZO6vUu19GqdFj7/KeLZUzuD2WLvWAxDXdXB FJtLqzffXK/oWxEWAPOujDhwGc6ekZWdloKDaz3x5V2hRxW8AujR0g0Zh236LZE2fpqS0Hd Shc/J91ime1ODMXXqMcRYgOdTNtzdxAEYYTL9DiX93RIPqp1blsLQBdqojoP2Tl8UbtXobv alhbjKxrMQAYo6qTJ+mQw== X-UI-Out-Filterresults: notjunk:1;V03:K0:S8JJSBgwprc=:FClAZEh3wPMNAs1aS+z9xi Y8khAXoZlxWxt45Hk7JJkecJEoTwNa2Bd+Mp+tDt7POa8rBNAYmnJtA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vvsjKEp5JKhzjCCk6pq34gFTtZBgwPYBsELfWCp gZG80= Sender: git-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Cast the evaluated value of the macro INITIAL_LOCK to void to instruct the compiler that we're not interested in said value nor the following warning: In file included from compat/nedmalloc/nedmalloc.c:63: compat/nedmalloc/malloc.c.h: In function ‘init_user_mstate’: compat/nedmalloc/malloc.c.h:1706:62: error: right-hand operand of comma expression has no effect [-Werror=unused-value] 1706 | #define INITIAL_LOCK(sl) (memset(sl, 0, sizeof(MLOCK_T)), 0) | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~ compat/nedmalloc/malloc.c.h:5020:3: note: in expansion of macro ‘INITIAL_LOCK’ 5020 | INITIAL_LOCK(&m->mutex); | ^~~~~~~~~~~~ Signed-off-by: René Scharfe --- compat/nedmalloc/malloc.c.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) -- 2.22.0 diff --git a/compat/nedmalloc/malloc.c.h b/compat/nedmalloc/malloc.c.h index 88c131ca93..9134349590 100644 --- a/compat/nedmalloc/malloc.c.h +++ b/compat/nedmalloc/malloc.c.h @@ -3066,7 +3066,7 @@ static int init_mparams(void) { #if !ONLY_MSPACES /* Set up lock for main malloc area */ gm->mflags = mparams.default_mflags; - INITIAL_LOCK(&gm->mutex); + (void)INITIAL_LOCK(&gm->mutex); #endif #if (FOOTERS && !INSECURE) @@ -5017,7 +5017,7 @@ static mstate init_user_mstate(char* tbase, size_t tsize) { mchunkptr msp = align_as_chunk(tbase); mstate m = (mstate)(chunk2mem(msp)); memset(m, 0, msize); - INITIAL_LOCK(&m->mutex); + (void)INITIAL_LOCK(&m->mutex); msp->head = (msize|PINUSE_BIT|CINUSE_BIT); m->seg.base = m->least_addr = tbase; m->seg.size = m->footprint = m->max_footprint = tsize;