X-Spam-Check-By: sourceware.org
Subject: Re: wrong macro definition in pthread.h
From: skaller <skaller@users.sourceforge.net>
To: =?UTF-8?Q?=E6=A9=8B_=E5=AE=8F=E5=BD=B0?= <hasi@cskk-sv.co.jp>
Cc: cygwin@cygwin.com
In-Reply-To: <20060213.212717.193713030.hasi@cskk-sv.co.jp>
References: <20060213.212717.193713030.hasi@cskk-sv.co.jp>
Content-Type: text/plain; charset=utf-8
Date: Tue, 14 Feb 2006 00:06:45 +1100
Message-Id: <1139836005.8591.384.camel@rosella.wigram>
Mime-Version: 1.0
Content-Transfer-Encoding: 8bit
X-IsSubscribed: yes
Mailing-List: contact cygwin-help@cygwin.com; run by ezmlm
Precedence: bulk
List-Unsubscribe: <mailto:cygwin-unsubscribe-archive-cygwin=delorie.com@cygwin.com>
List-Subscribe: <mailto:cygwin-subscribe@cygwin.com>
List-Archive: <http://sourceware.org/ml/cygwin/>
List-Post: <mailto:cygwin@cygwin.com>
List-Help: <mailto:cygwin-help@cygwin.com>, <http://sourceware.org/ml/#faqs>
Sender: cygwin-owner@cygwin.com
Mail-Followup-To: cygwin@cygwin.com
Delivered-To: mailing list cygwin@cygwin.com

On Mon, 2006-02-13 at 21:27 +0900, 橋 宏彰 wrote:
> In cvs head.
> 
> winsup/cygwin/include/pthread.h
> 
>   #define pthread_cleanup_push(_fn, _arg) { __pthread_cleanup_handler __cleanup_handler = \
>                                            { _fn, _arg, NULL }; \
>                                            _pthread_cleanup_push( &__cleanup_handler );
>   #define pthread_cleanup_pop(_execute) _pthread_cleanup_pop( _execute ); }
> 
> incorrect '}' position.
> 

>From my man pthread_cleanup_push:

Matching  pairs of !pthread_cleanup_push! and !pthread_cleanup_pop!
must occur in the same function, at the same level of  block  nest‐
ing.   Actually,  !pthread_cleanup_push!  and !pthread_cleanup_pop!
are macros, and the expansion of !pthread_cleanup_push!  introduces
an open brace !{!  with the matching closing brace !}! being intro‐
duced by the expansion of the matching !pthread_cleanup_pop!.

SO if this is a bug .. it is shared by Linux..:)

-- 
John Skaller <skaller at users dot sf dot net>
Felix, successor to C++: http://felix.sf.net


--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Problem reports:       http://cygwin.com/problems.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/

