This is the mail archive of the
cygwin
mailing list for the Cygwin project.
Re: Bug in sys/wait.h with C++
- From: Christopher Faylor <cgf-use-the-mailinglist-please at cygwin dot com>
- To: cygwin at cygwin dot com
- Date: Wed, 8 Feb 2012 01:10:36 -0500
- Subject: Re: Bug in sys/wait.h with C++
- References: <1328668786.8060.7.camel@YAAKOV04>
- Reply-to: cygwin at cygwin dot com
On Tue, Feb 07, 2012 at 08:39:46PM -0600, Yaakov (Cygwin/X) wrote:
>Just came across an issue with <sys/wait.h> in C++. STC:
>
>$ cat test.c
>#include <stddef.h>
>#include <sys/wait.h>
>int main(void) { wait(NULL); return 0; }
>
>$ gcc -Wall test.c
>
>$ gcc -x c++ -Wall test.c
>test.c: In function ???int main()???:
>test.c:2:27: error: call of overloaded ???wait(NULL)??? is ambiguous
>/usr/include/sys/wait.h:37:7: note: candidates are: pid_t wait(int*)
>/usr/include/sys/wait.h:82:14: note: pid_t wait(wait*)
>
>This code compiles cleanly on Linux.
I guess we have to incorporate Linux's head-standing in
/usr/include/sys/wait.h to allow both the use of union wait * and int as
arguments to wait().
Anyone want to send a patch to cygwin-patches?
cgf
--
Problem reports: http://cygwin.com/problems.html
FAQ: http://cygwin.com/faq/
Documentation: http://cygwin.com/docs.html
Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple