This is the mail archive of the
glibc-bugs@sources.redhat.com
mailing list for the glibc project.
[Bug libc/359] PTHREAD_[...]_INITIALIZER_NP macros from pthread.h break GNU C++ compilation
- From: "schnake at composition dot de" <sourceware-bugzilla at sources dot redhat dot com>
- To: glibc-bugs at sources dot redhat dot com
- Date: 31 Aug 2004 08:02:21 -0000
- Subject: [Bug libc/359] PTHREAD_[...]_INITIALIZER_NP macros from pthread.h break GNU C++ compilation
- References: <20040831075233.359.schnake@composition.de>
- Reply-to: sourceware-bugzilla at sources dot redhat dot com
------- 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.