| delorie.com/archives/browse.cgi | search |
| X-Recipient: | archive-cygwin AT delorie DOT com |
| X-Spam-Check-By: | sourceware.org |
| Date: | Wed, 8 Feb 2012 10:21:41 +0100 |
| From: | Corinna Vinschen <corinna-cygwin AT cygwin DOT com> |
| To: | cygwin AT cygwin DOT com |
| Subject: | Re: Bug in sys/wait.h with C++ |
| Message-ID: | <20120208092141.GD25129@calimero.vinschen.de> |
| Reply-To: | cygwin AT cygwin DOT com |
| Mail-Followup-To: | cygwin AT cygwin DOT com |
| References: | <1328668786 DOT 8060 DOT 7 DOT camel AT YAAKOV04> <20120208061036 DOT GD7184 AT ednor DOT casa DOT cgf DOT cx> <4F321831 DOT 8070401 AT t-online DOT de> |
| MIME-Version: | 1.0 |
| In-Reply-To: | <4F321831.8070401@t-online.de> |
| User-Agent: | Mutt/1.5.21 (2010-09-15) |
| Mailing-List: | contact cygwin-help AT cygwin DOT com; run by ezmlm |
| List-Id: | <cygwin.cygwin.com> |
| List-Unsubscribe: | <mailto:cygwin-unsubscribe-archive-cygwin=delorie DOT com AT cygwin DOT com> |
| List-Subscribe: | <mailto:cygwin-subscribe AT cygwin DOT com> |
| List-Archive: | <http://sourceware.org/ml/cygwin/> |
| List-Post: | <mailto:cygwin AT cygwin DOT com> |
| List-Help: | <mailto:cygwin-help AT cygwin DOT com>, <http://sourceware.org/ml/#faqs> |
| Sender: | cygwin-owner AT cygwin DOT com |
| Mail-Followup-To: | cygwin AT cygwin DOT com |
| Delivered-To: | mailing list cygwin AT cygwin DOT com |
On Feb 8 07:37, Christian Franke wrote:
> Christopher Faylor wrote:
> >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().
>
> Yes. Unfortunately the typesafe approach from
> http://cygwin.com/ml/cygwin-patches/2011-q4/msg00003.html
> does not work with NULL (0 in C++), sorry.
>
> Workaround: wait((int *)0) or wait((union wait *)0);
>
>
> >Anyone want to send a patch to cygwin-patches?
>
> I'll do soon.
Thanks!
Corinna
--
Corinna Vinschen Please, send mails regarding Cygwin to
Cygwin Project Co-Leader cygwin AT cygwin DOT com
Red Hat
--
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
| webmaster | delorie software privacy |
| Copyright © 2019 by DJ Delorie | Updated Jul 2019 |