From patchwork Wed Nov 4 11:39:59 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Riku Voipio X-Patchwork-Id: 55975 Delivered-To: patch@linaro.org Received: by 10.112.61.134 with SMTP id p6csp2366942lbr; Wed, 4 Nov 2015 03:41:35 -0800 (PST) X-Received: by 10.194.62.15 with SMTP id u15mr1536512wjr.18.1446637294999; Wed, 04 Nov 2015 03:41:34 -0800 (PST) Return-Path: Received: from lists.xen.org (lists.xen.org. [50.57.142.19]) by mx.google.com with ESMTPS id 76si5238380wmh.26.2015.11.04.03.41.34 (version=TLSv1 cipher=RC4-SHA bits=128/128); Wed, 04 Nov 2015 03:41:34 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of xen-devel-bounces@lists.xen.org designates 50.57.142.19 as permitted sender) client-ip=50.57.142.19; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of xen-devel-bounces@lists.xen.org designates 50.57.142.19 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xen.org; dkim=neutral (body hash did not verify) header.i=@linaro_org.20150623.gappssmtp.com Received: from localhost ([127.0.0.1] helo=lists.xen.org) by lists.xen.org with esmtp (Exim 4.72) (envelope-from ) id 1ZtwQB-00059N-3E; Wed, 04 Nov 2015 11:40:07 +0000 Received: from mail6.bemta3.messagelabs.com ([195.245.230.39]) by lists.xen.org with esmtp (Exim 4.72) (envelope-from ) id 1ZtwQA-00059D-1p for xen-devel@lists.xen.org; Wed, 04 Nov 2015 11:40:06 +0000 Received: from [85.158.137.68] by server-5.bemta-3.messagelabs.com id 01/45-01748-59EE9365; Wed, 04 Nov 2015 11:40:05 +0000 X-Env-Sender: riku.voipio@linaro.org X-Msg-Ref: server-5.tower-31.messagelabs.com!1446637204!961118!1 X-Originating-IP: [209.85.215.48] X-SpamReason: No, hits=0.0 required=7.0 tests= X-StarScan-Received: X-StarScan-Version: 7.19.2; banners=-,-,- X-VirusChecked: Checked Received: (qmail 35424 invoked from network); 4 Nov 2015 11:40:04 -0000 Received: from mail-lf0-f48.google.com (HELO mail-lf0-f48.google.com) (209.85.215.48) by server-5.tower-31.messagelabs.com with AES128-GCM-SHA256 encrypted SMTP; 4 Nov 2015 11:40:04 -0000 Received: by lfbf136 with SMTP id f136so37698943lfb.0 for ; Wed, 04 Nov 2015 03:40:04 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro_org.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id; bh=4vJCj1zyeVxGUXRRBNqCKGdKBdM+/m1qqCrT220qK/c=; b=LWwwR6MPdACdXV8VLhtt2EeU0bff2QG5L0sH6KOXs7jBhETQuDK3G38jRF0ycndWqC eaiFt/VXhoSGtHfYvfsHgRXQpZHYp38FxmnjBLd3UuMz3E44QwbWhmp+f/EDEuXn2WnN +MaW/FJADNTd8Yubq1r0hApKkChxNGpGalmILNU9P3iC1Rq+56Jp68nrMysGD5mj04vk 6hN71EBSH10OU4//QPqS87Y4bEK7Hbq1Q+7grgTpVAZTrv1IwuNdJPb+6vu9ntV61tx2 GuLqbMGnYzr3Fa631Q75gLQBdpe4CiJIHHeyRZZhI9LTQq0MCnQEAYQ6N63G3twtpHHI Gskg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=4vJCj1zyeVxGUXRRBNqCKGdKBdM+/m1qqCrT220qK/c=; b=RkorUqdZbVYNg8sJ94rAOQfxvDuHp6ninQax0UBi6IRRhc4Fue9sedSc/cyu0KcpJ5 l6y7O0KwnGm/3IHQsvCw1kApWxEOC4pyx4Ojxa+ikTODN8lBPPXs3L+kyITRzvekTZKr v9xL1rOfrBN/YR6QyJiKOde7Ty2Vo8ilVqNIfNRBb0H4CN9jI2wGMVA43ZBda07kXSXN JDxD+eg418foeNzaSKh4erfaSjRdOgvVWSVSBwCbIwVX8pULeI2oTxGzF9JpKe+KgkLR pI8crZCgaBu/Ei+WwvsY7mC3z5E7amcun1E0MCQ0oVKPWxQ7Rs9iP99lv1jth18lrtzT PCug== X-Gm-Message-State: ALoCoQmUF17kFba1toGR6PNTziqzzl0g5IX+9Tb+bDxpTYscOQfdkANSWG1suiKIPHAhPlXYnY21 X-Received: by 10.25.89.9 with SMTP id n9mr68733lfb.9.1446637204231; Wed, 04 Nov 2015 03:40:04 -0800 (PST) Received: from localhost.localdomain (91-157-175-207.elisa-laajakaista.fi. [91.157.175.207]) by smtp.gmail.com with ESMTPSA id lc3sm148840lbc.3.2015.11.04.03.40.02 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 04 Nov 2015 03:40:03 -0800 (PST) From: Riku Voipio To: xen-devel@lists.xen.org Date: Wed, 4 Nov 2015 13:39:59 +0200 Message-Id: <1446637199-18119-1-git-send-email-riku.voipio@linaro.org> X-Mailer: git-send-email 2.6.2 Cc: Riku Voipio , ian.campbell@citrix.com, Jan Beulich Subject: [Xen-devel] [PATCH] symbols.c: Avoid warn_unused_result build failure on fgets(). X-BeenThere: xen-devel@lists.xen.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org In commit: d37d63d symbols: prefix static symbols with their source file names An unchecked fgets was added. This causes a compile error: symbols.c: In function 'read_symbol': symbols.c:181:3: error: ignoring return value of 'fgets', declared with attribute warn_unused_result [-Werror=unused-result] fgets(str, 500, in); /* discard rest of line */ ^ Paper over the warning like in the other similar fgets-on-error-path earlier in the same file. Cc: Jan Beulich Signed-off-by: Riku Voipio --- xen/tools/symbols.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) -- 2.6.2 _______________________________________________ Xen-devel mailing list Xen-devel@lists.xen.org http://lists.xen.org/xen-devel diff --git a/xen/tools/symbols.c b/xen/tools/symbols.c index dbf6a1a..7e75be2 100644 --- a/xen/tools/symbols.c +++ b/xen/tools/symbols.c @@ -178,8 +178,8 @@ static int read_symbol(FILE *in, struct sym_entry *s) skip_tail: if (input_format == fmt_sysv) - fgets(str, 500, in); /* discard rest of line */ - + if (fgets(str, 500, in) == NULL) /* discard rest of line */ + return -1; /* must check fgets result */ return rc; }