From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 7970 invoked by alias); 1 Feb 2013 21:31:15 -0000 Received: (qmail 7950 invoked by uid 22791); 1 Feb 2013 21:31:13 -0000 X-SWARE-Spam-Status: No, hits=-2.6 required=5.0 tests=AWL,BAYES_00,KHOP_SPAMHAUS_DROP,KHOP_THREADED,RCVD_IN_HOSTKARMA_YE X-Spam-Check-By: sourceware.org Received: from na3sys009aog123.obsmtp.com (HELO na3sys009aog123.obsmtp.com) (74.125.149.149) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Fri, 01 Feb 2013 21:31:07 +0000 Received: from mx10.qnx.com ([209.226.137.110]) (using TLSv1) by na3sys009aob123.postini.com ([74.125.148.12]) with SMTP ID DSNKUQw0GzZR+6H778J9PSm9M7Sh/nmcCCaH@postini.com; Fri, 01 Feb 2013 13:31:07 PST Received: by mx10.qnx.com (Postfix, from userid 500) id 810E220E60; Fri, 1 Feb 2013 16:31: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 mx10.qnx.com (Postfix) with ESMTPS id 4518420E0A; Fri, 1 Feb 2013 16:31: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; Fri, 1 Feb 2013 16:31:06 -0500 Message-ID: <510C3418.4040802@qnx.com> Date: Fri, 01 Feb 2013 21:31: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: Tom Tromey CC: "gdb-patches@sourceware.org" Subject: Re: [patch] cleanup: Wunused corefile.c References: <510AC74E.1010709@qnx.com> <87vcad5cf1.fsf@fleche.redhat.com> <510AD43E.3040405@qnx.com> <87boc34z0o.fsf@fleche.redhat.com> In-Reply-To: <87boc34z0o.fsf@fleche.redhat.com> Content-Type: multipart/mixed; boundary="------------050807000406080506090906" 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-02/txt/msg00036.txt.bz2 --------------050807000406080506090906 Content-Type: text/plain; charset="ISO-8859-1"; format=flowed Content-Transfer-Encoding: 7bit Content-length: 1126 On 13-02-01 02:25 PM, Tom Tromey wrote: > > I understand, but I think the hard part of this work is also the most > useful part. What I mean is that it is certainly valuable to get all > the simple cases fixed; but going through the trickier cases and writing > proper fixes is the real benefit of enabling this warning -- finding and > fixing real bugs. Making these warnings disappear is contrary to that. > I agree and I don't agree. I'm not shy from hard work, but I simply have limited time resources for contributing back to FSF. I really believe making warnings disappear and turning on Wunused by default would make a big difference worth "obscuring" a bug or two (they are already obscure as we are not aware of them). Once Wunused is on by default, there will not be creeping in of unused stuff any more. But here is revised patch for corefile.c. Not that it represents any hard work or anything, but since I was at... Thanks, Aleksandar Ristovski QNX Software Systems ChangeLog: Aleksandar Ristovski * corefile.c (reopen_exec_file): Check return value from stat. --------------050807000406080506090906 Content-Type: text/x-patch; name="Wunused-corefile-201302010947.patch" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="Wunused-corefile-201302010947.patch" Content-length: 767 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 1 Feb 2013 15:42:17 -0000 @@ -149,7 +149,11 @@ reopen_exec_file (void) cleanups = make_cleanup (xfree, filename); res = stat (filename, &st); - if (exec_bfd_mtime && exec_bfd_mtime != st.st_mtime) + if (res != 0 && info_verbose) + warning (_("File %s could not be stat-ed (%s)\n"), filename, + strerror (res)); + + if (res == 0 && exec_bfd_mtime && exec_bfd_mtime != st.st_mtime) exec_file_attach (filename, 0); else /* If we accessed the file since last opening it, close it now; --------------050807000406080506090906--