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 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 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline 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 Precedence: bulk List-Id: List-Unsubscribe: List-Subscribe: List-Archive: List-Post: List-Help: , 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 in C++. STC: > >> > >>$ cat test.c > >>#include > >>#include > >>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