From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wr0-f196.google.com (mail-wr0-f196.google.com [209.85.128.196]) by dpdk.org (Postfix) with ESMTP id F22A4322C for ; Sat, 31 Mar 2018 17:10:02 +0200 (CEST) Received: by mail-wr0-f196.google.com with SMTP id 80so10116807wrb.2 for ; Sat, 31 Mar 2018 08:10:02 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=6wind-com.20150623.gappssmtp.com; s=20150623; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:content-transfer-encoding:in-reply-to :user-agent; bh=9glV0bVIPP0ZV1wBd3r9D8oNw09iXXNQrqLd7eyDuHE=; b=o6Pw+SZ5hlnZ9zshGOuYgN3pcy/JkZwlWnoCzG27V16wURSQ6x1McLyUdqPXJ4djDM H/w6CIuEMcGNZms/sqyZV7nlrEPjKU67YRD+WgEQBun+W72XyVYrYmTBgLYwovaDl2ja Yrnd55+1I8ru4ZoJAx9Mp6JvdxTMK0v9ypsdDeuii9f+hqkNaolKRUVgDeTnVUnz+PbK RcJLRdzJYjbWiP3cT5h+LemT1SN2b1WOm4wgZrCeqZdwTxK7to6IRED63AXLf0g2zVbS soSg6xD+psXOMf8pw9s7tTpeIhsvYj6wvcld1HaGJzY7F3kWZ/8xAsY8f4UomAfLCgIU FzBQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:content-transfer-encoding :in-reply-to:user-agent; bh=9glV0bVIPP0ZV1wBd3r9D8oNw09iXXNQrqLd7eyDuHE=; b=pg3qTQ6WbLdiXDlfAHkheTN5h/9s3pAJoOHZBrawP9qqOJq4qgzWJy6KUEVTaNmIJD YfHBA8SyEIsyzcG1R7leQl+jWahwqFWpUkSSb5tOj3aPbCeyueyD3BLmWgvLEX9lAN8u gezPEDdngcG93y6q9EsaXAjfZpEgBGEq2qRnGFnpOgA//fU67nufbRTxescsWNcSTAtI j9neCs0eE5ns8RBYC5diokut7LR8x2YfYMch0cdNPTx8DFkj4mc+tzLfLCSaIPyZwU6a MitxwCo65wfUvGIoo+57wqj32iG0BqSA/Q5PHNmDvUHfeDStHyQyNqM6rLOpPJvyRRpt C4UA== X-Gm-Message-State: AElRT7E10q9XU8mSemEeb7POCtpQNcDC+7bWE5GWAAgBjTwIh+umre+y dev86exTNC8sU21R1nnqCOoj/A== X-Google-Smtp-Source: AIpwx49qVhNNEHCu2+1hvGEXWYbrAw9s+XFUKyD8sOgkqE0dvAWVD58eEU4QuY+wqts9RRSRZo6yPA== X-Received: by 10.223.156.133 with SMTP id d5mr2265947wre.60.1522509002399; Sat, 31 Mar 2018 08:10:02 -0700 (PDT) Received: from bidouze.vm.6wind.com (host.78.145.23.62.rev.coltfrance.com. [62.23.145.78]) by smtp.gmail.com with ESMTPSA id f2sm5199913wre.31.2018.03.31.08.10.00 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Sat, 31 Mar 2018 08:10:01 -0700 (PDT) Date: Sat, 31 Mar 2018 17:09:47 +0200 From: =?iso-8859-1?Q?Ga=EBtan?= Rivet To: Neil Horman Cc: Tonghao Zhang , Timothy Redaelli , Maxime Coquelin , Andrew Rybchenko , "dev@dpdk.org" , Ferruh Yigit , Thomas Monjalon Message-ID: <20180331150947.5ob35sxk2iw4f4fq@bidouze.vm.6wind.com> References: <93d00a28-d52d-25b3-42d0-84b1d95c756a@redhat.com> <20180330162830.1d7ccba2@redhat.com> <20180331133342.GA31292@neilslaptop.think-freely.org> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20180331133342.GA31292@neilslaptop.think-freely.org> User-Agent: NeoMutt/20170113 (1.7.2) Subject: Re: [dpdk-dev] Build is broken in dpdk-next-net X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 31 Mar 2018 15:10:03 -0000 On Sat, Mar 31, 2018 at 09:33:43AM -0400, Neil Horman wrote: > On Fri, Mar 30, 2018 at 10:47:09PM +0800, Tonghao Zhang wrote: > > I rebuild it on ubuntu 17.10 and cash it. I use the 'RTE_SET_USED' to fix it. > > > > > > diff --git a/lib/librte_vhost/fd_man.c b/lib/librte_vhost/fd_man.c > > index 771675718..f11803191 100644 > > --- a/lib/librte_vhost/fd_man.c > > +++ b/lib/librte_vhost/fd_man.c > > @@ -279,7 +279,8 @@ fdset_pipe_read_cb(int readfd, void *dat __rte_unused, > > int *remove __rte_unused) > > { > > char charbuf[16]; > > - read(readfd, charbuf, sizeof(charbuf)); > > + int r = read(readfd, charbuf, sizeof(charbuf)); > > + RTE_SET_USED(r); > > } > > > > void > > @@ -319,5 +320,6 @@ fdset_pipe_init(struct fdset *fdset) > > void > > fdset_pipe_notify(struct fdset *fdset) > > { > > - write(fdset->u.writefd, "1", 1); > > + int r = write(fdset->u.writefd, "1", 1); > > + RTE_SET_USED(r); > > } > > > > A better option might be to use _Pragma > > Something like this perhaps > > #define ALLOW_UNUSED(x) \ > _Pragma(push) \ > _Pragma(diagnostic ignored "-Wunused-result") \ > #x;\ > _Pragma(pop) > > This is of course untested, so it probably needs some tweaking, but this method > avoids the need to declare an additional stack variable, which i don't think can > be eliminated due to the cast. I believe that this method should also work > accross compilers (the gcc and clang compilers support this, and i think the > intel compiler should as well) > > Neil > It would be nice to avoid the definition of a useless variable. An alternative could be if (read() < 0) { /* Failure here is acceptable for such and such reason. */ } to ensure all-around compatibility, and the definition or another macro. Just a suggestion. -- Gaëtan Rivet 6WIND