This is the mail archive of the
mailing list for the GDB project.
Re: MinGW compilation warnings in libiberty's waitpid.c
- From: Pedro Alves <palves at redhat dot com>
- To: Eli Zaretskii <eliz at gnu dot org>, gcc-patches at gcc dot gnu dot org
- Cc: gdb-patches at sourceware dot org
- Date: Fri, 19 May 2017 16:36:46 +0100
- Subject: Re: MinGW compilation warnings in libiberty's waitpid.c
- Authentication-results: sourceware.org; auth=none
- 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 at redhat dot com
- Dkim-filter: OpenDKIM Filter v2.11.0 mx1.redhat.com 46AD47AE9B
- Dmarc-filter: OpenDMARC Filter v1.3.2 mx1.redhat.com 46AD47AE9B
- References: <firstname.lastname@example.org>
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
Maybe it was used at some point when libiberty was a target library?
So I wonder whether we could just unconditionally remove the waitpid