From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 3462 invoked by alias); 29 Sep 2008 17:59:56 -0000 Received: (qmail 3454 invoked by uid 22791); 29 Sep 2008 17:59:56 -0000 X-Spam-Check-By: sourceware.org Received: from sv2.lisha.ufsc.br (HELO smtp.lisha.ufsc.br) (150.162.62.2) by sourceware.org (qpsmtpd/0.31) with ESMTP; Mon, 29 Sep 2008 17:58:58 +0000 Received: by smtp.lisha.ufsc.br (Postfix, from userid 99) id 71609BF02A; Mon, 29 Sep 2008 14:58:54 -0300 (BRT) Received: from [192.168.1.5] (unknown [189.34.5.16]) (Authenticated sender: ramiro) by smtp.lisha.ufsc.br (Postfix) with ESMTP id 2E3D1BEFE8 for ; Mon, 29 Sep 2008 14:58:53 -0300 (BRT) Message-ID: <48E1175C.3020400@lisha.ufsc.br> Date: Mon, 29 Sep 2008 17:59:00 -0000 From: Ramiro Polla User-Agent: Thunderbird 2.0.0.14 (Windows/20080421) MIME-Version: 1.0 To: pthreads-win32@sourceware.org Subject: _POSIX_C_SOURCE-related problems 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/msg00050.txt.bz2 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