public inbox for gcc-prs@sourceware.org
help / color / mirror / Atom feed
From: wolfgang.bangerth@iwr.uni-heidelberg.de
To: gcc-gnats@gcc.gnu.org
Subject: other/2764: Fixinclude should fix PTHREAD_MUTEX_INITIALIZER on Solaris2.7
Date: Mon, 07 May 2001 10:56:00 -0000	[thread overview]
Message-ID: <20010507174552.18124.qmail@sourceware.cygnus.com> (raw)

>Number:         2764
>Category:       other
>Synopsis:       Fixinclude should fix PTHREAD_MUTEX_INITIALIZER on Solaris2.7
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    unassigned
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Mon May 07 10:56:00 PDT 2001
>Closed-Date:
>Last-Modified:
>Originator:     Wolfgang Bangerth
>Release:        unknown-1.0
>Organization:
>Environment:
sparc-sun-solaris2.7, gcc version 3.0 20010507 (prerelease)
>Description:
In the definition of PTHREAD_MUTEX_INITIALIZER in 
/usr/include/pthread.h some elements of the
pthread_mutex_t structure are not initialized, leading
to warnings with -ansi -Wall:

>How-To-Repeat:

>Fix:
fixincludes should change the definition of PTHREAD_MUTEX_INITIALIZER
in /usr/include/pthread.h, line 63, from
  #define	PTHREAD_MUTEX_INITIALIZER	{{{0}, 0}, {{{0}}}, 0}
to something that matches the declaration of the pthread_mutex_t
structure better:

typedef struct _pthread_mutex {
        struct {
                uint8_t __pthread_mutex_flag[4];
                uint32_t __pthread_mutex_type;
        } __pthread_mutex_flags;
        union {
                struct {
                        uint8_t __pthread_mutex_pad[8];
                } __pthread_mutex_lock64;
                upad64_t __pthread_mutex_owner64;
        } __pthread_mutex_lock;
        upad64_t __pthread_mutex_data;
} pthread_mutex_t;

(Sorry, I am not enough a C hacker to know how to initialize
the union properly :-)

Regards
  Wolfgang
>Release-Note:
>Audit-Trail:
>Unformatted:
 >>>> c++ -ansi -Wall -o /dev/null -c a.cc 
 a.cc:2: warning: aggregate has a partly bracketed initializer
 
 >>>> cat a.cc
 #include <pthread.h>
 pthread_mutex_t t = PTHREAD_MUTEX_INITIALIZER;
 
 
 The same error also occured with gcc2.95. However, the new
 libstdc++ includes this file in some place, so more people
 will probably see this problem with gcc3 than with previous
 gcc versions.


             reply	other threads:[~2001-05-07 10:56 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2001-05-07 10:56 wolfgang.bangerth [this message]
2001-07-31 13:06 ljrittle

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20010507174552.18124.qmail@sourceware.cygnus.com \
    --to=wolfgang.bangerth@iwr.uni-heidelberg.de \
    --cc=gcc-gnats@gcc.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).