This is the mail archive of the glibc-bugs@sources.redhat.com mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug libc/359] PTHREAD_[...]_INITIALIZER_NP macros from pthread.h break GNU C++ compilation


------- Additional Comments From schnake at composition dot de  2004-08-31 08:02 -------
Description: 
============ 
g++ refuses to compile C++ code that uses one of the pthread.h declared macros 
PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP, PTHREAD_ERRORCHECK_MUTEX_INITIALIZER_NP 
or PTHREAD_ADAPTIVE_MUTEX_INITIALIZER_NP. 
 
Reproducible: 
============= 
Always 
 
Steps to Reproduce: 
=================== 
Try to compile following with g++: 
#include <pthread.h> 
pthread_mutex_t mymutex = PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP; 
 
Actual Results:   
=============== 
error: parse error before `.' token  
 
Expected Results: 
=================   
AFAIK this *is* the expected result, as GNU C++ does not support the designated  
initializer extension that is used in pthread.h to declare the macros mentioned  
above.  
 
Possible solution: 
================== 
Change pthread.h to use non-designated initializers instead.  
  
My configuration (Gentoo ebuilds): 
==================================  
sys-libs/glibc-2.3.4.20040808 + NTPL 
sys-devel/gcc-3.3.4-r1 
  
More info: 
========== 
http://gcc.gnu.org/onlinedocs/gcc/Designated-Inits.html 

-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
            Summary|PTHREAD_*_                  |PTHREAD_[...]_INITIALIZER_NP
                   |                            |macros from pthread.h break
                   |                            |GNU C++ compilation


http://sources.redhat.com/bugzilla/show_bug.cgi?id=359

------- You are receiving this mail because: -------
You are on the CC list for the bug, or are watching someone who is.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]