Message ID | 1447059973-11330-1-git-send-email-riku.voipio@linaro.org |
---|---|
State | New |
Headers | show
Delivered-To: patch@linaro.org Received: by 10.112.155.196 with SMTP id vy4csp68178lbb; Mon, 9 Nov 2015 01:08:21 -0800 (PST) X-Received: by 10.140.29.33 with SMTP id a30mr6233311qga.88.1447060101740; Mon, 09 Nov 2015 01:08:21 -0800 (PST) Return-Path: <xen-devel-bounces@lists.xen.org> Received: from lists.xen.org ([50.57.142.19]) by mx.google.com with ESMTPS id v64si10354823qka.98.2015.11.09.01.08.21 (version=TLSv1 cipher=RC4-SHA bits=128/128); Mon, 09 Nov 2015 01:08:21 -0800 (PST) Received-SPF: neutral (google.com: 50.57.142.19 is neither permitted nor denied by best guess record for domain of xen-devel-bounces@lists.xen.org) client-ip=50.57.142.19; Authentication-Results: mx.google.com; spf=neutral (google.com: 50.57.142.19 is neither permitted nor denied by best guess record for domain of xen-devel-bounces@lists.xen.org) 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 <xen-devel-bounces@lists.xen.org>) id 1ZviP9-0006rD-8x; Mon, 09 Nov 2015 09:06:23 +0000 Received: from mail6.bemta3.messagelabs.com ([195.245.230.39]) by lists.xen.org with esmtp (Exim 4.72) (envelope-from <riku.voipio@linaro.org>) id 1ZviP7-0006r8-AO for xen-devel@lists.xen.org; Mon, 09 Nov 2015 09:06:21 +0000 Received: from [85.158.137.68] by server-4.bemta-3.messagelabs.com id 93/58-09570-C0260465; Mon, 09 Nov 2015 09:06:20 +0000 X-Env-Sender: riku.voipio@linaro.org X-Msg-Ref: server-14.tower-31.messagelabs.com!1447059979!2013460!1 X-Originating-IP: [209.85.217.171] 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 55929 invoked from network); 9 Nov 2015 09:06:19 -0000 Received: from mail-lb0-f171.google.com (HELO mail-lb0-f171.google.com) (209.85.217.171) by server-14.tower-31.messagelabs.com with AES128-GCM-SHA256 encrypted SMTP; 9 Nov 2015 09:06:19 -0000 Received: by lbces9 with SMTP id es9so24130417lbc.2 for <xen-devel@lists.xen.org>; Mon, 09 Nov 2015 01:06:19 -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=N7csgEUPw9eOi439VMMecGogYQsjzhm52TT9HGf3YDU=; b=EpmP7/rOWb7cZLKRFeNXbl+f+xs2q0MRDLOO7tktcRCr8BEMJ0K9/W8Blk5XeqM+BY 3QUL0sDeveF12BflZFd5mazuLypoIsr2SL1K1X7IkpB61VbIyD0PoxAwBmMIn9xkDUNY jOQbaLG762NXsMQYm/m9GpNXt0Vh6FszEeFAaPP2ollpkK5CbN+dVmeEJr4JVUvgfV2G BKPn+lOU2Y+EzFKhz7OQHrJBUOFzMTY/QNR/k93JIHt87oSWPbUYRmrYV9RAYAeAk5t/ Vwko744Xf/9yuXXsJK+d5OAfRe1DcHPWjQ9cvi7Omf6ebatLISxLyRLkFpJSEpnEQRUQ NwUA== 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=N7csgEUPw9eOi439VMMecGogYQsjzhm52TT9HGf3YDU=; b=ZWvHmoVVUHiJMY4bQzfnXRsFtEB4HKMfj7cScYbiW/tXVjp3NNNvROMEoFP6Ww6582 b9Tqnhen8ysnWomNaP7rsJaWpVWw34Hfqx06HprrbuHDAfFgntgws76iiVHf64vzgHwy eifnQy4gQuz99t5Wynge3OY59IBrigFFGfa6xJJI3NBdidohOtVKyKqxWL0mpUKtBgr9 JrqNqWaMm7WVypyuPvEGYO7bs64T4Js0PfakItX2oUcb2FWvIKbSeKP7X2raEy7ppBuI XdaJS2p/YhGq+gNeLGYDtQ0ky+7E/yD71PPk6r8qvNSb7xOtEJv3+CKVext9USAv2Iyp jcZg== X-Gm-Message-State: ALoCoQkPbmOVz9BBhBUYDSD3cH0Q6bWz8taumLe7qrUrutJeJfISj6rYyPXYdm978GZmiILAMmoN X-Received: by 10.112.64.41 with SMTP id l9mr13842490lbs.32.1447059979180; Mon, 09 Nov 2015 01:06:19 -0800 (PST) Received: from localhost.localdomain (91-157-175-207.elisa-laajakaista.fi. [91.157.175.207]) by smtp.gmail.com with ESMTPSA id xt6sm2166469lbb.25.2015.11.09.01.06.17 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 09 Nov 2015 01:06:17 -0800 (PST) From: Riku Voipio <riku.voipio@linaro.org> To: xen-devel@lists.xen.org Date: Mon, 9 Nov 2015 11:06:13 +0200 Message-Id: <1447059973-11330-1-git-send-email-riku.voipio@linaro.org> X-Mailer: git-send-email 2.6.2 Cc: Riku Voipio <riku.voipio@linaro.org>, ian.campbell@citrix.com, Jan Beulich <jbeulich@suse.com> Subject: [Xen-devel] [PATCH v2] 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 <xen-devel.lists.xen.org> List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>, <mailto:xen-devel-request@lists.xen.org?subject=unsubscribe> List-Post: <mailto:xen-devel@lists.xen.org> List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help> List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xen.org?subject=subscribe> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org |
diff --git a/xen/tools/symbols.c b/xen/tools/symbols.c index dbf6a1a..3b8fa39 100644 --- a/xen/tools/symbols.c +++ b/xen/tools/symbols.c @@ -177,8 +177,8 @@ static int read_symbol(FILE *in, struct sym_entry *s) rc = 0; skip_tail: - if (input_format == fmt_sysv) - fgets(str, 500, in); /* discard rest of line */ + if ((input_format == fmt_sysv) && fgets(str, 500, in) == NULL) + return rc; /* discard rest of line and ignore errors */ return rc; }
In commit: d37d63d symbols: prefix static symbols with their source file names An unchecked fgets was added. This causes a compile error at least on ubuntu utopic: 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 by checking the return value in the if statement. Cc: Jan Beulich <jbeulich@suse.com> Signed-off-by: Riku Voipio <riku.voipio@linaro.org> --- 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