From patchwork Tue May 23 19:24:46 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Eli Zaretskii X-Patchwork-Id: 20552 Received: (qmail 91590 invoked by alias); 23 May 2017 19:25:05 -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 91529 invoked by uid 89); 23 May 2017 19:25:04 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-11.0 required=5.0 tests=AWL, BAYES_00, GIT_PATCH_2, GIT_PATCH_3, RP_MATCHES_RCVD, SPF_PASS autolearn=unavailable version=3.3.2 spammy= X-HELO: eggs.gnu.org Received: from eggs.gnu.org (HELO eggs.gnu.org) (208.118.235.92) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Tue, 23 May 2017 19:25:03 +0000 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dDFQU-00039f-1D for gdb-patches@sourceware.org; Tue, 23 May 2017 15:25:05 -0400 Received: from fencepost.gnu.org ([2001:4830:134:3::e]:37332) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dDFQT-00039b-Uv; Tue, 23 May 2017 15:25:01 -0400 Received: from 84.94.185.246.cable.012.net.il ([84.94.185.246]:1514 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1dDFQS-0001pj-1T; Tue, 23 May 2017 15:25:01 -0400 Date: Tue, 23 May 2017 22:24:46 +0300 Message-Id: <83poezml4x.fsf@gnu.org> From: Eli Zaretskii To: DJ Delorie CC: gcc-patches@gcc.gnu.org, gdb-patches@sourceware.org In-reply-to: (message from DJ Delorie on Mon, 22 May 2017 15:38:40 -0400) Subject: Re: MinGW compilation warnings in libiberty's waitpid.c Reply-to: Eli Zaretskii References: X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2001:4830:134:3::e X-IsSubscribed: yes > From: DJ Delorie > Cc: gcc-patches@gcc.gnu.org, gdb-patches@sourceware.org > Date: Mon, 22 May 2017 15:38:40 -0400 > > Since (or "if") nobody will (should) use waitpid() on mingw anyway, and > since libiberty really wants to include waitpid.o, how difficult would > it be to use some #ifdefs to have waitpid() just return an error on > mingw? That at least gets past the mingw build problem. Instead of making waitpid an always-failing stub on MinGW, wouldn't it be better to make it work on MinGW? Like this: --- libiberty/waitpid.c~0 2016-08-01 18:50:21.000000000 +0300 +++ libiberty/waitpid.c 2017-05-23 21:19:34.302415000 +0300 @@ -23,6 +23,11 @@ does the return value. The third argume #include #endif +#ifdef __MINGW32__ +#include +#define wait(s) _cwait(s,pid,_WAIT_CHILD) +#endif + pid_t waitpid (pid_t pid, int *stat_loc, int options ATTRIBUTE_UNUSED) {