From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 3625 invoked by alias); 17 Dec 2014 22:42:11 -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 3605 invoked by uid 89); 17 Dec 2014 22:42:10 -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_HELO_PASS,T_RP_MATCHES_RCVD autolearn=ham version=3.3.2 X-HELO: mx1.redhat.com Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES256-GCM-SHA384 encrypted) ESMTPS; Wed, 17 Dec 2014 22:42:08 +0000 Received: from int-mx10.intmail.prod.int.phx2.redhat.com (int-mx10.intmail.prod.int.phx2.redhat.com [10.5.11.23]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id sBHMfvDp013772 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=FAIL); Wed, 17 Dec 2014 17:41:57 -0500 Received: from [127.0.0.1] (ovpn01.gateway.prod.ext.ams2.redhat.com [10.39.146.11]) by int-mx10.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id sBHMfssU000576; Wed, 17 Dec 2014 17:41:54 -0500 Message-ID: <549206B1.40902@redhat.com> Date: Wed, 17 Dec 2014 22:42:00 -0000 From: Pedro Alves User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.3.0 MIME-Version: 1.0 To: Jan Kratochvil , Kai Tietz , Steve Ellcey CC: Eli Zaretskii , brobecker@adacore.com, yao@codesourcery.com, gdb-patches@sourceware.org Subject: Re: [patch] compile: rm -rf -> ftw()+rmdir()+unlink() [Re: [patch] compile: Fix MinGW build] References: <20141217210144.GA26674@host2.jankratochvil.net> In-Reply-To: <20141217210144.GA26674@host2.jankratochvil.net> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit X-SW-Source: 2014-12/txt/msg00505.txt.bz2 On 12/17/2014 09:01 PM, Jan Kratochvil wrote: > On Tue, 16 Dec 2014 10:04:02 +0100, Kai Tietz wrote: >> Why not using here instead an implementation using FTW-API? > > Done. > > >> At least mingw-w64 added this API recently to runtime for gcc's sake, so >> implementation of an 'rm -rf' should be pretty easy. > > It has built on Fedora 21 x86_64 mingw64 for both 32-bit and 64-bit targets. > I am not sure about various other Unices but if the patch gets approved... Well, if the patch gets approved, what's the plan then? :-) See https://www.gnu.org/software/gnulib/manual/html_node/ftw.html: "This function is missing on some platforms: Mac OS X 10.3, FreeBSD 5.2.1, NetBSD 3.0, Minix 3.1.8, mingw, MSVC 9, BeOS. " Note that's problems _not_ fixed by Gnulib. In reality, there's no real ftw module in gnulib. But there _is_ an fts module. So it seems to me that we should use the fts API instead of ftw. And then we'll either need to import the gnulib module, or start out with an autoconf check. > > > On Wed, 17 Dec 2014 18:29:51 +0100, Steve Ellcey wrote: >> /scratch/sellcey/repos/nightly2/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 > > It should get fixed by this patch. > > > I have briefly tested (on Linux; on MinGW I have only tested the build) it > really does delete the directory and its files. > > OK for check-in? Thanks, Pedro Alves