Click to See Complete Forum and Search --> : Strange Boost Thread Issue


styxx22
June 28th, 2009, 03:05 PM
I've been having some troubles figuring out why this error is occuring deep within the bowls of other code.

This occurs when I include thread & mutex header files from boost libraries for a class that has a single thread implemented.

Visual Studio 2008 level 4

c:\boost\include\boost-1_39\boost\date_time\microsec_time_clock.hpp(103) : warning C4244: 'argument' : conversion from 'int' to 'unsigned short', possible loss of data c:\boost\include\boost-1_39\boost\thread\thread_time.hpp(20) : see reference to class template instantiation 'boost::date_time::microsec_clock<time_type>' being compiled1>c:\boost\include\boost-1_39\boost\date_time\microsec_time_clock.hpp(103) : warning C4244: 'argument' : conversion from 'int' to 'unsigned short', possible loss of data
1>c:\boost\include\boost-1_39\boost\date_time\microsec_time_clock.hpp(103) : warning C4244: 'argument' : conversion from 'int' to 'unsigned short', possible loss of data
1>c:\boost\include\boost-1_39\boost\utility\addressof.hpp(30) : warning C4512: 'boost::detail::addr_impl_ref<T>' : assignment operator could not be generated

... and a few other errors.

There is absalutely no implicit coversions within the code I have written.

I simply create a single thread within the entire program.

If anyone knows or could point me in the right direction would be great!

Thanks

styxx22
June 28th, 2009, 03:07 PM
... and a few other errors.

Thanks

... and a few other warnings*

styxx22
June 28th, 2009, 03:10 PM
Here are my includes:


#include <string>
#include <iostream>

#include <boost/thread/thread.hpp>
#include <boost/thread/mutex.hpp>
#include <boost/bind.hpp>

#include <boost/regex.hpp>

#include <boost/filesystem/fstream.hpp>
#include <boost/filesystem/operations.hpp>
#include <boost/filesystem/convenience.hpp>
#include <boost/filesystem.hpp>

#include <boost/foreach.hpp>
#include <boost/lexical_cast.hpp>
#include <boost/algorithm/string/trim.hpp>
#include <boost/tokenizer.hpp>

#include <list>
#include <vector>

STLDude
June 28th, 2009, 03:52 PM
Not all boost compiles cleanly specially using warning level 4.
I use well placed pragma to turn them on and off.
#pragma warning(push)
#pragma warning (disable : 4100) // '' : unreferenced formal parameter
#include <boost/variant.hpp>
#pragma warning(pop)

styxx22
June 28th, 2009, 04:47 PM
Problem solved thanks.

Lindley
July 6th, 2009, 06:29 PM
Not all boost compiles cleanly specially using warning level 4.
I use well placed pragma to turn them on and off.
#pragma warning(push)
#pragma warning (disable : 4100) // '' : unreferenced formal parameter
#include <boost/variant.hpp>
#pragma warning(pop)


If you tell the Boost mailing list about this including your compiler, someone may actually get around to fixing it.