From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 18208 invoked by alias); 6 Jan 2015 16:04:22 -0000 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 Received: (qmail 18192 invoked by uid 89); 6 Jan 2015 16:04:20 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.0 required=5.0 tests=AWL,BAYES_00,SPF_PASS,T_RP_MATCHES_RCVD autolearn=ham version=3.3.2 X-HELO: mailapp01.imgtec.com Received: from mailapp01.imgtec.com (HELO mailapp01.imgtec.com) (195.59.15.196) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Tue, 06 Jan 2015 16:04:19 +0000 Received: from KLMAIL01.kl.imgtec.org (unknown [192.168.5.35]) by Websense Email Security Gateway with ESMTPS id 6FA24A3C8E7DA; Tue, 6 Jan 2015 16:04:14 +0000 (GMT) Received: from BAMAIL02.ba.imgtec.org (10.20.40.28) by KLMAIL01.kl.imgtec.org (192.168.5.35) with Microsoft SMTP Server (TLS) id 14.3.195.1; Tue, 6 Jan 2015 16:04:17 +0000 Received: from [192.168.65.53] (192.168.65.53) by bamail02.ba.imgtec.org (10.20.40.28) with Microsoft SMTP Server (TLS) id 14.3.174.1; Tue, 6 Jan 2015 08:04:15 -0800 Message-ID: <1420560255.15691.21.camel@ubuntu-sellcey> Subject: Re: [Patch] Fix build problem with system call in compile/compile.c From: Steve Ellcey Reply-To: To: Joel Brobecker CC: Date: Tue, 06 Jan 2015 16:04:00 -0000 In-Reply-To: <20150106041615.GJ5445@adacore.com> References: <20150106041615.GJ5445@adacore.com> Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit MIME-Version: 1.0 X-SW-Source: 2015-01/txt/msg00077.txt.bz2 On Tue, 2015-01-06 at 08:16 +0400, Joel Brobecker wrote: > > diff --git a/gdb/compile/compile.c b/gdb/compile/compile.c > > index 1d18bd7..f9f03f1 100644 > > --- a/gdb/compile/compile.c > > +++ b/gdb/compile/compile.c > > @@ -169,10 +169,12 @@ do_rmdir (void *arg) > > { > > const char *dir = arg; > > char *zap; > > + int i; > > > > gdb_assert (strncmp (dir, TMP_PREFIX, strlen (TMP_PREFIX)) == 0); > > zap = concat ("rm -rf ", dir, (char *) NULL); > > - system (zap); > > + /* GCC may generate warning if we ignore the return value of system call. */ > > + i = system (zap); > > } > > > > /* Return the name of the temporary directory to use for .o files, and > > Does it work to cast the result of the call to system to (void) > instead? In your case, I fear that you'd be exchanging one warning > (return value being ignored) by another (value assigned but never > used). No, I tried using "(void) system (zap);" instead of "i = system (zap);" and I still got the warning message. I am going to respond on the "GDB 7.9 branching" email thread that I think this bug is a blocking bug since it breaks the build on some machines. I certainly think it needs to be addressed somehow before we release the next GDB. Steve Ellcey sellcey@imgtec.com