From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 14385 invoked by alias); 31 Aug 2004 08:02:22 -0000 Mailing-List: contact glibc-bugs-help@sources.redhat.com; run by ezmlm Precedence: bulk List-Subscribe: List-Post: List-Help: , Sender: glibc-bugs-owner@sources.redhat.com Received: (qmail 14374 invoked by uid 48); 31 Aug 2004 08:02:21 -0000 Date: Tue, 31 Aug 2004 08:02:00 -0000 Message-ID: <20040831080221.14373.qmail@sourceware.org> From: "schnake at composition dot de" To: glibc-bugs@sources.redhat.com In-Reply-To: <20040831075233.359.schnake@composition.de> References: <20040831075233.359.schnake@composition.de> Reply-To: sourceware-bugzilla@sources.redhat.com Subject: [Bug libc/359] PTHREAD_[...]_INITIALIZER_NP macros from pthread.h break GNU C++ compilation X-Bugzilla-Reason: CC X-SW-Source: 2004-08/txt/msg00208.txt.bz2 List-Id: ------- 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_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.