This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
target/7971: Fixing pthread.h for Solaris v2.6
- From: ahelm at gmx dot net
- To: gcc-gnats at gcc dot gnu dot org
- Date: 18 Sep 2002 15:02:08 -0000
- Subject: target/7971: Fixing pthread.h for Solaris v2.6
- Reply-to: ahelm at gmx dot net
>Number: 7971
>Category: target
>Synopsis: Fixing pthread.h for Solaris v2.6
>Confidential: no
>Severity: non-critical
>Priority: medium
>Responsible: unassigned
>State: open
>Class: change-request
>Submitter-Id: net
>Arrival-Date: Wed Sep 18 08:06:02 PDT 2002
>Closed-Date:
>Last-Modified:
>Originator: ahelm@gmx.net
>Release: all 3.x GCC releases
>Organization:
>Environment:
Solaris 2.6
>Description:
GCC complains about "partly bracketed initialiser" when
using any >> or << operators in C++ to stdin/stdout/stderr.
The reason is a bug in the Solaris v2.6 supplied pthread.h.
As fixincludes is already making a copy of this file
and modifies the very same line that contains the
incomplete initialiser, I don't see why fixincludes cannot
fix this file properly.
As far as I understand Sun Microsystems is not willing to fix this bug.
The original file (line 54):
#define PTHREAD_MUTEX_INITIALIZER {0, 0, 0} /* = DEFAULTMUTEX */
The GCC version after fixincludes (now line 63):
#if __STDC__ - 0 == 0 && !defined(_NO_LONGLONG)
#define PTHREAD_MUTEX_INITIALIZER {0, 0, 0} /* = DEFAULTMUTEX */
#else
#define PTHREAD_MUTEX_INITIALIZER {0, 0, {0}} /* = DEFAULTMUTEX */
#endif
Should be (line 63):
#if __STDC__ - 0 == 0 && !defined(_NO_LONGLONG)
#define PTHREAD_MUTEX_INITIALIZER {{{0}, 0}, {{{0}}}, 0} /* = DEFAULTMUTEX */
#else
#define PTHREAD_MUTEX_INITIALIZER {0, 0, {0}} /* = DEFAULTMUTEX */
#endif
>How-To-Repeat:
>Fix:
Get fixincludes to change the line
#define PTHREAD_MUTEX_INITIALIZER {0, 0, 0} /* = DEFAULTMUTEX */
into
#define PTHREAD_MUTEX_INITIALIZER {{{0}, 0}, {{{0}}}, 0} /* = DEFAULTMUTEX */
in GCCs copy of pthread.h if host is Solaris 2.6.
>Release-Note:
>Audit-Trail:
>Unformatted: