From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-pg0-f47.google.com (mail-pg0-f47.google.com [74.125.83.47]) by dpdk.org (Postfix) with ESMTP id 22A182BFE for ; Thu, 7 Sep 2017 19:50:29 +0200 (CEST) Received: by mail-pg0-f47.google.com with SMTP id d8so731484pgt.4 for ; Thu, 07 Sep 2017 10:50:29 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=networkplumber-org.20150623.gappssmtp.com; s=20150623; h=date:from:to:cc:subject:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=luRpQPMPYXISOSjFU72LSoO9zn/9CKiDvnLScEBIMn4=; b=fHTqWjknG40xTljy8/x1X62b3m8Eln3EBMOlDwOWi8YAwENKnRblPo83b/fCKSbKHa da0eEHkO4slnXvtODkbKoPHWRexR73hJDPMviChjzOrhI78FxKEfcowqsV1vnJg/Rjzg S4GlKfLIp2GzJb2IL2+FHWcYPJB93ZggFfYjJn+xP0Odrl+G/e30kpdSfJC6IEipBXeD n4S/1/170l32s5G4KYGhBHcgtz0fhuCVEg3KuPrCbdQKMTP2utZVrPkIKerJotDGR7GP EklMpSDtkLtpG0iaQEP1tLuAMeZnaP7j/dfNfh2yUJpKC+lK11XUhLEoTW3BQqiFDEQo b8Bw== 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:in-reply-to :references:mime-version:content-transfer-encoding; bh=luRpQPMPYXISOSjFU72LSoO9zn/9CKiDvnLScEBIMn4=; b=oFQocN/8D8Y3g/yKN9uM8FL85/cWGu1QH1ZfdF1pG/oNFLbcILkxz2tlQgHQC1HjLE du7jd17nNo+D6FE0xhx2mqUKqfGVePW0fek6ZPzgGTaOS7AoccCDj+gDjvdMsUiinUrP XEJ6O+E9u30VEjm01F8lh9JOjSfhzod1ZfR8obGNM7gMfyQnP/72Ba7NVmh70vhz43HR V/lMlXDYR3sTcmGfzOSvm/L3ORqwJjK3ssi2vDuZjgZzZK1U4Lm+ljT4fG72xzlaOZp7 +aybG7VwjAllhVRfVxgxHaWW3apAJLmdq8eSfEDNzUWoi60IgoQlRVDhtUlfwLRvwuy5 TDIw== X-Gm-Message-State: AHPjjUhJWg6+xnjTFDsHr8iil/41UUvILy7tQIPJdjYWuUvv+UGdz8uu sLJ80v8QdHNasdb+/hGiCA== X-Google-Smtp-Source: ADKCNb6EAFyGbe+dcC6TxnmpHYuie1cVYU5tyM4JIiCfzL9IkXWzf5goeUO2eGspbBjOlXAMbVKlJA== X-Received: by 10.84.131.12 with SMTP id 12mr129479pld.69.1504806628960; Thu, 07 Sep 2017 10:50:28 -0700 (PDT) Received: from xeon-e3 (76-14-207-240.or.wavecable.com. [76.14.207.240]) by smtp.gmail.com with ESMTPSA id v71sm339438pfa.45.2017.09.07.10.50.28 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Thu, 07 Sep 2017 10:50:28 -0700 (PDT) Date: Thu, 7 Sep 2017 10:50:20 -0700 From: Stephen Hemminger To: Bruce Richardson Cc: dev@dpdk.org Message-ID: <20170907105020.62f8eb79@xeon-e3> In-Reply-To: <20170907130923.157924-1-bruce.richardson@intel.com> References: <20170907130923.157924-1-bruce.richardson@intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Subject: Re: [dpdk-dev] [PATCH] cmdline: fix warning for unused return value 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: Thu, 07 Sep 2017 17:50:30 -0000 On Thu, 7 Sep 2017 14:09:23 +0100 Bruce Richardson wrote: > When DPDK is compiled on Ubuntu with extra warnings turned on, there is a > warning about the return value from write() being unchecked. Rather than > having builds disable the warning, which may mask other cases we do care > about, we can add a dummy use of the return value in the code to silence it > in this instance. > > Signed-off-by: Bruce Richardson > --- > lib/librte_cmdline/cmdline.c | 3 ++- > 1 file changed, 2 insertions(+), 1 deletion(-) > > diff --git a/lib/librte_cmdline/cmdline.c b/lib/librte_cmdline/cmdline.c > index a9c47be..d749165 100644 > --- a/lib/librte_cmdline/cmdline.c > +++ b/lib/librte_cmdline/cmdline.c > @@ -205,7 +205,8 @@ cmdline_printf(const struct cmdline *cl, const char *fmt, ...) > } > if (ret >= BUFSIZ) > ret = BUFSIZ - 1; > - write(cl->s_out, buf, ret); > + ret = write(cl->s_out, buf, ret); > + (void)ret; That is an ugly way to fix the warning. If write fails, the user has probably logged out.