From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 15795 invoked by alias); 7 Jan 2015 19:29:07 -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 15773 invoked by uid 89); 7 Jan 2015 19:29:06 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-0.9 required=5.0 tests=AWL,BAYES_00,T_RP_MATCHES_RCVD autolearn=ham version=3.3.2 X-HELO: cvs.linux-mips.org Received: from eddie.linux-mips.org (HELO cvs.linux-mips.org) (148.251.95.138) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Wed, 07 Jan 2015 19:29:05 +0000 Received: from localhost.localdomain ([127.0.0.1]:43218 "EHLO localhost.localdomain" rhost-flags-OK-OK-OK-OK) by eddie.linux-mips.org with ESMTP id S27010191AbbAGT3DBy1kR (ORCPT ); Wed, 7 Jan 2015 20:29:03 +0100 Date: Wed, 07 Jan 2015 19:29:00 -0000 From: "Maciej W. Rozycki" To: Steve Ellcey cc: Joel Brobecker , gdb-patches@sourceware.org, Yao Qi , Chen Gang Subject: Re: [Patch] Fix build problem with system call in compile/compile.c In-Reply-To: <1420655766.15691.44.camel@ubuntu-sellcey> Message-ID: References: <20150106041615.GJ5445@adacore.com> <1420560255.15691.21.camel@ubuntu-sellcey> <20150107041351.GN5445@adacore.com> <1420655766.15691.44.camel@ubuntu-sellcey> User-Agent: Alpine 2.11 (LFD 23 2013-08-11) MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-IsSubscribed: yes X-SW-Source: 2015-01/txt/msg00138.txt.bz2 On Wed, 7 Jan 2015, Steve Ellcey wrote: > > In that case, I have no objection to your patch either, provided > > a small comment is added to explain why we allow ourselves to ignore > > the return value (and since you'll be touching that code anyways, > > I would also rename your variable to something more explicit, such > > as "ignored" or "unused" for instance). > > > > Thank you, > > I am not sure why we allow ourselves to ignore the return value. Maybe > we shouldn't. Chen Gang submitted a different patch where the return > value is checked. Should we use that instead? > > https://sourceware.org/ml/gdb-patches/2015-01/msg00011.html The best idea IMHO as well. However I have concerns about this function overall in the first place. GDB supports hosts that have no `rm' program. It may support (although this I am less sure about) hosts that do not support the `system' C library call in a way we are used to; specifically there may not be a command processor available as noted in the ISO C document defining the API. Therefore I think it would be best to rewrite it to only use the relevant C library calls like `remove' and `rmdir' to recursively remove a directory; I wonder if actually we don't have something relevant already available in libiberty or gnulib. That of course does not mean we oughtn't to make a temporary fix to the immediate problem discussed here, I certainly don't object that. FWIW, Maciej