public inbox for gcc@gcc.gnu.org
 help / color / mirror / Atom feed
* Re: Problem compiling libstdc++ is current 4.0.2 cvs (volatile strikes again)
@ 2005-07-25  6:59 Haren Visavadia
  2005-07-25  7:53 ` Kean Johnston
  0 siblings, 1 reply; 10+ messages in thread
From: Haren Visavadia @ 2005-07-25  6:59 UTC (permalink / raw)
  To: gcc

--- Kean Johnston <jkj@sco.com> wrote:
> System V Release 5 (UnixWare / OpenServer 6).
> 
 
Your system is NOT supported by GCC, please read
http://www.fsf.org/licensing/sco/




		
___________________________________________________________ 
How much free photo storage do you get? Store your holiday 
snaps for FREE with Yahoo! Photos http://uk.photos.yahoo.com

^ permalink raw reply	[flat|nested] 10+ messages in thread
* Problem compiling libstdc++ is current 4.0.2 cvs (volatile strikes again)
@ 2005-07-21 21:42 Kean Johnston
  2005-07-25  4:15 ` Michael Veksler
  0 siblings, 1 reply; 10+ messages in thread
From: Kean Johnston @ 2005-07-21 21:42 UTC (permalink / raw)
  To: gcc

Hi all,

I hope someone can help me. I am C++ impaired, and I am getting
the following error when trying to bootstrap the current 4.0.2
CVS. The error is coming from include/ext/bitmap_allocator.h
line 111. The relevant code snippet is:

class _Mutex {
   __gthread_mutex_t _M_mut;

   // Prevent Copying and assignment.
   _Mutex(_Mutex const&);
   _Mutex& operator=(_Mutex const&);

  public:
   _Mutex()
   {
     if (__threads_enabled)
       {
#if !defined __GTHREAD_MUTEX_INIT
         _GTHREAD_MUTEX_INIT_FUNCTION(&_M_mut);
#else
         __gthread_mutex_t __mtemp = __GTHREAD_MUTEX_INIT;
         _M_mut = __mtemp;    <<<<<<<< THIS CAUSES THE ERROR
#endif
       }
   }

I get the following error message from the compiler:
error: no match for 'operator=' in 
'((__gnu_cxx::_Mutex)this)->__gnu_cxx::_Mutex::_M_Mut = __mtemp'

*/gcc/include/sys/types.h:678: note: candidates are: __pthread_mutex& 
__pthread_mutex::operator=(const __pthread_mutex&)

The contents of sys/types.h at that location are:
typedef volatile struct __pthread_mutex {
    mutex_t		__pt_mutex_mutex;
    pid_t		__pt_mutex_pid;
    thread_t		__pt_mutex_owner;
    int			__pt_mutex_depth;
    pthread_mutexattr_t	__pt_mutex_attr;
} pthread_mutex_t;

If I remove the 'volatile' keyword, then everything just works.
So, do I adjust fixincludes to remove the 'volatile' keyword,
or is this some weird side effect of the recent discussions on
volatile (which I didn't read).

Any help / advice appreciated.

Oh PS ... if I change that from a simple assignment to:
   __builtin_memcpy((void *)&_M_mut, (const void *)&__mtemp, 
sizeof(__gthread_mutex_t));
Then it also just works. I could of course adjust the header file
to do that for the platform.

Kean

^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2005-08-22 12:30 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2005-07-25  6:59 Problem compiling libstdc++ is current 4.0.2 cvs (volatile strikes again) Haren Visavadia
2005-07-25  7:53 ` Kean Johnston
2005-07-25  8:17   ` Haren Visavadia
2005-07-25  8:27     ` Kean Johnston
2005-07-25  8:33       ` Haren Visavadia
2005-07-25  9:04         ` Gabriel Dos Reis
2005-08-22 12:30         ` Kai Ruottu
  -- strict thread matches above, loose matches on Subject: below --
2005-07-21 21:42 Kean Johnston
2005-07-25  4:15 ` Michael Veksler
2005-07-25  6:49   ` Kean Johnston

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).