From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 39436 invoked by alias); 19 May 2017 15:36:50 -0000 Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Received: (qmail 39412 invoked by uid 89); 19 May 2017 15:36:49 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.9 required=5.0 tests=BAYES_00,RP_MATCHES_RCVD,SPF_HELO_PASS autolearn=unavailable version=3.3.2 spammy= 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 ESMTP; Fri, 19 May 2017 15:36:48 +0000 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 46AD47AE9B; Fri, 19 May 2017 15:36:49 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com 46AD47AE9B Authentication-Results: ext-mx01.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com Authentication-Results: ext-mx01.extmail.prod.ext.phx2.redhat.com; spf=pass smtp.mailfrom=palves@redhat.com DKIM-Filter: OpenDKIM Filter v2.11.0 mx1.redhat.com 46AD47AE9B Received: from [127.0.0.1] (ovpn04.gateway.prod.ext.ams2.redhat.com [10.39.146.4]) by smtp.corp.redhat.com (Postfix) with ESMTP id 4BD6A60BE1; Fri, 19 May 2017 15:36:47 +0000 (UTC) Subject: Re: MinGW compilation warnings in libiberty's waitpid.c To: Eli Zaretskii , gcc-patches@gcc.gnu.org References: <83inlbcqsp.fsf@gnu.org> Cc: gdb-patches@sourceware.org From: Pedro Alves Message-ID: <68029888-74e5-7cd3-1a66-2e58919a6435@redhat.com> Date: Fri, 19 May 2017 15:40:00 -0000 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.4.0 MIME-Version: 1.0 In-Reply-To: <83inlbcqsp.fsf@gnu.org> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit X-SW-Source: 2017-05/txt/msg01586.txt.bz2 On 05/08/2017 04:27 PM, Eli Zaretskii wrote: > When compiling libiberty (as part of GDB) with MinGW on MS-Windows, I > see the following warning: > > gcc -c -DHAVE_CONFIG_H -O2 -gdwarf-4 -g3 -D__USE_MINGW_ACCESS -I. -I./../include -W -Wall -Wwrite-strings -Wc++-compat -Wstrict-prototypes -pedantic -D_GNU_SOURCE ./waitpid.c -o waitpid.o > ./waitpid.c: In function 'waitpid': > ./waitpid.c:31:18: warning: implicit declaration of function 'wait' [-Wimplicit-function-declaration] > int wpid = wait(stat_loc); > ^ > > The file waitpid.c should not be built on MinGW, as it is not needed > on Windows, and will not work if the function is called (because > there's no 'wait' function on MS-Windows). > Makes sense, but did you check whether there's an obvious place such a change could be done in configure.ac? I wonder what code relies on this replacement, actually. In liberty, the only waitpid calls are in pex-unix.c, but those are all guarded by HAVE_WAITPID. Maybe it was used at some point when libiberty was a target library? So I wonder whether we could just unconditionally remove the waitpid replacement instead. Thanks, Pedro Alves