This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC 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]

target/7971: Fixing pthread.h for Solaris v2.6


>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:


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