Bug 884 - There is error in nptl's nptl/pthreadP.h header file
Summary: There is error in nptl's nptl/pthreadP.h header file
Status: RESOLVED FIXED
Alias: None
Product: glibc
Classification: Unclassified
Component: nptl (show other bugs)
Version: 2.3.5
: P2 normal
Target Milestone: ---
Assignee: Ulrich Drepper
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2005-04-28 08:52 UTC by Alexey Bazhin
Modified: 2005-04-28 09:25 UTC (History)
1 user (show)

See Also:
Host:
Target:
Build:
Last reconfirmed:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Alexey Bazhin 2005-04-28 08:52:05 UTC
There is error in nptl's nptl/pthreadP.h header file. It should fixed like this:

--- pthreadP.h  2004-11-20 10:14:55.000000000 +0300
+++ pthreadP.h.fixed    2005-04-28 12:50:51.216102600 +0400
@@ -429,13 +429,13 @@
 # undef pthread_cleanup_push
 # define pthread_cleanup_push(routine,arg) \
   { struct _pthread_cleanup_buffer _buffer;                                  \
-    __pthread_cleanup_push (&_buffer, (routine), (arg));
+    __pthread_cleanup_push (&_buffer, (routine), (arg)); }
 
 extern void __pthread_cleanup_pop (struct _pthread_cleanup_buffer *buffer,
                                   int execute) attribute_hidden;
 # undef pthread_cleanup_pop
 # define pthread_cleanup_pop(execute) \
-    __pthread_cleanup_pop (&_buffer, (execute)); }
+    __pthread_cleanup_pop (&_buffer, (execute));
 #endif
 
 extern void __pthread_cleanup_push_defer (struct _pthread_cleanup_buffer *buffer,
Comment 1 Alexey Bazhin 2005-04-28 09:11:56 UTC
oops... like this:

--- pthreadP.h  2004-11-20 10:14:55.000000000 +0300
+++ pthreadP.h.fixed    2005-04-28 13:09:55.524141336 +0400
@@ -429,12 +429,13 @@
 # undef pthread_cleanup_push
 # define pthread_cleanup_push(routine,arg) \
   { struct _pthread_cleanup_buffer _buffer;                                  \
-    __pthread_cleanup_push (&_buffer, (routine), (arg));
+    __pthread_cleanup_push (&_buffer, (routine), (arg)); }
 
 extern void __pthread_cleanup_pop (struct _pthread_cleanup_buffer *buffer,
                                   int execute) attribute_hidden;
 # undef pthread_cleanup_pop
 # define pthread_cleanup_pop(execute) \
+  { struct _pthread_cleanup_buffer _buffer;                                  \
     __pthread_cleanup_pop (&_buffer, (execute)); }
 #endif
 
Comment 2 Jakub Jelinek 2005-04-28 09:25:15 UTC
You are wrong.  First read
http://www.opengroup.org/onlinepubs/009695399/functions/pthread_cleanup_pop.html
to see what they are actually supposed to do, particularly:
     These functions may be implemented as macros. The application shall ensure
that they appear as statements, and in pairs
     within the same lexical scope (that is, the pthread_cleanup_push() macro may
be thought to expand to a token list whose
     first token is '{' with pthread_cleanup_pop() expanding to a token list
whose last token is the corresponding '}' ).
Both macros must use the same local _buffer variable.