From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 17909 invoked by alias); 29 Sep 2008 22:56:54 -0000 Received: (qmail 17900 invoked by uid 22791); 29 Sep 2008 22:56:53 -0000 X-Spam-Check-By: sourceware.org Received: from flexo.grapevine.net.au (HELO flexo.grapevine.net.au) (203.129.32.140) by sourceware.org (qpsmtpd/0.31) with ESMTP; Mon, 29 Sep 2008 22:55:56 +0000 Received: from localhost (localhost [127.0.0.1]) by flexo.grapevine.net.au (Postfix) with ESMTP id F3514580EAE; Tue, 30 Sep 2008 08:55:51 +1000 (EST) Received: from flexo.grapevine.net.au ([127.0.0.1]) by localhost (flexo.grapevine.net.au [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id VBNQm1+u8ofz; Tue, 30 Sep 2008 08:55:51 +1000 (EST) Received: from localhost.localdomain (ppp-6.206.127.121.grapevine.net.au [121.127.206.6]) by flexo.grapevine.net.au (Postfix) with ESMTP id A1903580EA2; Tue, 30 Sep 2008 08:55:51 +1000 (EST) Message-ID: <48E15CF6.4020402@homemail.com.au> Date: Mon, 29 Sep 2008 22:56:00 -0000 From: Ross Johnson User-Agent: Thunderbird 2.0.0.14 (X11/20080501) MIME-Version: 1.0 To: Ramiro Polla CC: pthreads-win32@sourceware.org Subject: Re: _POSIX_C_SOURCE-related problems References: <48E1175C.3020400@lisha.ufsc.br> In-Reply-To: <48E1175C.3020400@lisha.ufsc.br> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-IsSubscribed: yes Mailing-List: contact pthreads-win32-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: pthreads-win32-owner@sourceware.org X-SW-Source: 2008/txt/msg00051.txt.bz2 This came up recently and a temporary fix was placed in CVS (sched.h). Really though, the PTW32_LEVEL stuff needs to be reviewed and appears to be incorrect, i.e. the line in both sched.h and pthread.h #if defined(_POSIX_C_SOURCE) && _POSIX_C_SOURCE >= 199309 is setting PTW32_LEVEL equal to 1, which is wrong for you (should be 3). Regards. Ross Ramiro Polla wrote: > Hello, > > Simple testcase using MinGW gcc 4.2.4, mingw-runtime 3.15, w32api 3.12: > > ----------------------------------------------------------------------- > ramiro@FOUND ~/code/smalls > $ cat > pthread.c << EOF > > #include > > EOF > > ramiro@FOUND ~/code/smalls > $ gcc -o pthread.o -c pthread.c -D_POSIX_C_SOURCE=200112 > In file included from e:/mingw/include/pthread.h:288, > from pthread.c:1: > e:/mingw/include/sched.h:152: error: expected ')' before 'pid' > e:/mingw/include/sched.h:154: error: expected ')' before 'pid' > ----------------------------------------------------------------------- > > This snippet in sched.h (pthreads-w32-2-8-0) starting at line 116 > seems suspicious: > > ----------------------------------------------------------------------- > #if defined(__MINGW32__) || defined(_UWIN) > #if PTW32_LEVEL >= PTW32_LEVEL_MAX > /* For pid_t */ > # include > /* Required by Unix 98 */ > # include > #endif /* PTW32_LEVEL >= PTW32_LEVEL_MAX */ > #else > typedef int pid_t; > #endif > ----------------------------------------------------------------------- > > PTW32_LEVEL_MAX is defined to 3 in line 61. PTW32_LEVEL is set to 1 > under this snippet starting at line 49: > > ----------------------------------------------------------------------- > #if defined(_POSIX_C_SOURCE) && _POSIX_C_SOURCE >= 199309 > #undef PTW32_LEVEL > #define PTW32_LEVEL 1 > /* Include 1b, 1c and 1d */ > #endif > ----------------------------------------------------------------------- > > I don't understand why sys/types.h isn't included when _POSIX_C_SOURCE > is defined to 200112. It should be, right? According to [0], pid_t > must be defined in sys/types.h. > > Ramiro Polla > [0]http://www.opengroup.org/onlinepubs/009695399/basedefs/sys/types.h.html >