From patchwork Tue Jan 6 00:44:21 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Steve Ellcey X-Patchwork-Id: 4517 Received: (qmail 32290 invoked by alias); 6 Jan 2015 00:44:29 -0000 Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org Delivered-To: mailing list gdb-patches@sourceware.org Received: (qmail 32279 invoked by uid 89); 6 Jan 2015 00:44:28 -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 00:44:27 +0000 Received: from KLMAIL01.kl.imgtec.org (unknown [192.168.5.35]) by Websense Email Security Gateway with ESMTPS id 824D948E8CEC2 for ; Tue, 6 Jan 2015 00:44:20 +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 00:44:24 +0000 Received: from ubuntu-sellcey.mips.com (192.168.65.53) by bamail02.ba.imgtec.org (10.20.40.28) with Microsoft SMTP Server id 14.3.174.1; Mon, 5 Jan 2015 16:44:21 -0800 Received: by ubuntu-sellcey.mips.com (sSMTP sendmail emulation); Mon, 05 Jan 2015 16:44:21 -0800 From: "Steve Ellcey " Date: Mon, 5 Jan 2015 16:44:21 -0800 To: Subject: [Patch] Fix build problem with system call in compile/compile.c User-Agent: Heirloom mailx 12.5 6/20/10 MIME-Version: 1.0 Message-ID: I am building gdb (and all of binutils) on ubuntu 12.04 with GCC 4.6.3. During compilation the gdb build fails with: /scratch/sellcey/repos/nightly_test/src/binutils-gdb/gdb/compile/compile.c:175:10: error: ignoring return value of 'system', declared with attribute warn_unused_result [-Werror=unused-result] cc1: all warnings being treated as errors make[1]: *** [compile.o] Error 1 make[1]: *** Waiting for unfinished jobs.... make[1]: Leaving directory `/scratch/sellcey/repos/nightly_test/obj-mips-img-linux-gnu/binutils-gdb/gdb' make: *** [all-gdb] Error 2 I am not sure why other people aren't running into this but I would like to apply this patch to fix the build problem. OK to checkin? Steve Ellcey sellcey@imgtec.com 2015-01-05 Steve Ellcey * compile/compile.c (do_rmdir): Assign return value of system call. 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