Boost logo

Boost :

From: larsbj_at_[hidden]
Date: 2001-10-13 06:08:45


To compile boost threads with g++ version:
gcc version 2.96 20000731 (Red Hat Linux 7.1 2.96-85)

This is not done with the Jam build system, but with
autoconf/automake/libtool.

without warnings and a compile failure I have to do these changes:

Warnings about unused arguments:

--- boost/libs/thread/src/mutex.cpp Tue Sep 25 02:04:45 2001
+++ local/boost/libs/thread/src/mutex.cpp Thu Oct 11 22:50:08 2001@@ -199,7 +199,7 @@
     assert(res == 0);
 }
 
-void mutex::do_lock(cv_state& state)
+void mutex::do_lock(cv_state& /*state*/)
 {
 }
 
@@ -248,7 +248,7 @@
     assert(res == 0);
 }
 
-void try_mutex::do_lock(cv_state& state)
+void try_mutex::do_lock(cv_state& /*state*/)
 {
 }
 
@@ -367,7 +367,7 @@
     assert(res == 0);
 }
 
-void timed_mutex::do_lock(cv_state& state)
+void timed_mutex::do_lock(cv_state& /*state*/)
 {
     int res = 0;
     while (m_locked)

Compile error on the cast:

--- boost/libs/thread/src/once.cpp Tue Sep 25 02:04:45 2001
+++ local/boost/libs/thread/src/once.cpp Thu Oct 11 22:46:52 2001@@ -38,7 +38,8 @@
 
 static void do_once()
 {
- once_callback cb = reinterpret_cast<once_callback>(pthread_getspecific(key));
+ //once_callback cb = reinterpret_cast<once_callback>(pthread_getspecific(key));
+ once_callback cb = (once_callback)(pthread_getspecific(key));
     (*cb)();
 }
 
@@ -85,7 +86,7 @@
        }
 #elif defined(BOOST_HAS_PTHREADS)
     pthread_once(&once, &key_init);
- pthread_setspecific(key, func);
+ pthread_setspecific(key, (void *)func);
        pthread_once(&flag, do_once);
 #endif
 }

Unsigned/signed warning:

--- boost/libs/thread/src/timeconv.inl Tue Sep 25 02:04:45 2001
+++ local/boost/libs/thread/src/timeconv.inl Thu Oct 11 22:48:38 2001@@ -23,7 +23,7 @@
         xt.sec += (milliseconds / MILLISECONDS_PER_SECOND);
         xt.nsec += ((milliseconds % MILLISECONDS_PER_SECOND) * NANOSECONDS_PER_MILLISECOND);
 
- if (xt.nsec > NANOSECONDS_PER_SECOND)
+ if (xt.nsec > static_cast<const int>(NANOSECONDS_PER_SECOND))
         {
             ++xt.sec;
             xt.nsec -= NANOSECONDS_PER_SECOND;

-- 
	Lgb

Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk