From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 25877 invoked by alias); 31 Jan 2013 19:36:15 -0000 Received: (qmail 25837 invoked by uid 22791); 31 Jan 2013 19:36:14 -0000 X-SWARE-Spam-Status: No, hits=-1.9 required=5.0 tests=AWL,BAYES_00,KHOP_SPAMHAUS_DROP,RCVD_IN_HOSTKARMA_YE X-Spam-Check-By: sourceware.org Received: from na3sys009aog135.obsmtp.com (HELO na3sys009aog135.obsmtp.com) (74.125.149.84) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Thu, 31 Jan 2013 19:36:07 +0000 Received: from mx20.qnx.com ([72.1.200.103]) (using TLSv1) by na3sys009aob135.postini.com ([74.125.148.12]) with SMTP ID DSNKUQrHprocq7Z56PpBYGRhqWEa5edcLRb+@postini.com; Thu, 31 Jan 2013 11:36:07 PST Received: by mx20.qnx.com (Postfix, from userid 500) id 6802420E1D; Thu, 31 Jan 2013 14:36:06 -0500 (EST) Received: from exhts.ott.qnx.com (exch2 [10.222.2.136]) (using TLSv1 with cipher AES128-SHA (128/128 bits)) (No client certificate requested) by mx20.qnx.com (Postfix) with ESMTPS id 38C2020A6E for ; Thu, 31 Jan 2013 14:36:06 -0500 (EST) Received: from [10.222.96.215] (10.222.2.5) by exch2.ott.qnx.com (10.222.2.136) with Microsoft SMTP Server id 14.2.318.4; Thu, 31 Jan 2013 14:36:06 -0500 Message-ID: <510AC74E.1010709@qnx.com> Date: Thu, 31 Jan 2013 19:36:00 -0000 From: Aleksandar Ristovski User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/20130106 Thunderbird/17.0.2 MIME-Version: 1.0 Newsgroups: gmane.comp.gdb.patches To: "gdb-patches@sourceware.org" Subject: [patch] cleanup: Wunused corefile.c Content-Type: multipart/mixed; boundary="------------010709040303000400020904" Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org X-SW-Source: 2013-01/txt/msg00774.txt.bz2 --------------010709040303000400020904 Content-Type: text/plain; charset="ISO-8859-1"; format=flowed Content-Transfer-Encoding: 7bit Content-length: 546 Hello, In addition to already posted/committed Wunused I have a bunch of patches which work around unused vars by adding attribute unused. Rationale was: either it was unclear whether the assignment might have side-effects or there was something that should have been done (e.g. this case) with the variable. Let me know if this is acceptable approach. Thank you, Aleksandar Ristovski QNX Software Systems ChangeLog: * corefile.c (reopen_exec_file): Add unused attribute to res, add FIXME comment for future cleanup. --------------010709040303000400020904 Content-Type: text/x-patch; name="Wunused-corefile-201301311429.patch" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="Wunused-corefile-201301311429.patch" Content-length: 755 Index: gdb/corefile.c =================================================================== RCS file: /cvs/src/src/gdb/corefile.c,v retrieving revision 1.71 diff -u -p -r1.71 corefile.c --- gdb/corefile.c 14 Jan 2013 21:03:54 -0000 1.71 +++ gdb/corefile.c 30 Jan 2013 22:25:14 -0000 @@ -136,7 +136,7 @@ void reopen_exec_file (void) { char *filename; - int res; + int res __attribute__ ((unused)); struct stat st; struct cleanup *cleanups; @@ -149,6 +149,8 @@ reopen_exec_file (void) cleanups = make_cleanup (xfree, filename); res = stat (filename, &st); + /* FIXME: error checking using 'res' (and remove attribute unused). */ + if (exec_bfd_mtime && exec_bfd_mtime != st.st_mtime) exec_file_attach (filename, 0); else --------------010709040303000400020904--