X-Recipient: archive-cygwin AT delorie DOT com X-SWARE-Spam-Status: No, hits=-1.7 required=5.0 tests=AWL,BAYES_00,RCVD_IN_DNSWL_NONE,T_RP_MATCHES_RCVD,UNPARSEABLE_RELAY X-Spam-Check-By: sourceware.org Message-ID: <4F321831.8070401@t-online.de> Date: Wed, 08 Feb 2012 07:37:37 +0100 From: Christian Franke User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:7.0.1) Gecko/20110928 Firefox/7.0.1 SeaMonkey/2.4.1 MIME-Version: 1.0 To: cygwin AT cygwin DOT com Subject: Re: Bug in sys/wait.h with C++ References: <1328668786 DOT 8060 DOT 7 DOT camel AT YAAKOV04> <20120208061036 DOT GD7184 AT ednor DOT casa DOT cgf DOT cx> In-Reply-To: <20120208061036.GD7184@ednor.casa.cgf.cx> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-IsSubscribed: yes Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm List-Id: 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 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. Christian -- 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