Boost logo

Boost Users :

Subject: Re: [Boost-users] boost::thread - many compiler warnings
From: Geoff Shapiro (gshapiro_at_[hidden])
Date: 2010-05-12 11:57:58


Anthony Williams <anthony.ajw <at> gmail.com> writes:
>
> Manfred Schwind <lists <at> mani.de> writes:
> >
> > #include "boost/thread.hpp"
> >
> > The warnings are just two kinds of warnings:
> > 1.) warning: implicit conversion shortens 64-bit value into a 32-bit value
> > 2.) warning: missing initializer for member '...'
> >
> > An example for the first warning can be found in gregorian_calender.ipp
(just showing relevant parts):
>
> Most of these warnings are from the Boost.DateTime library, which is
> used by Boost.Thread. I believe they are all harmless, if annoying.

Our development group's process specifically disallows any warnings in code
before it is released. Some exceptions have been made in intransigent
situations, but the warnings mentioned above do not fall into that category.
Therefore, we have been forced to wrap thread.hpp's inclusion as follows:

#if defined(_MSC_VER)
#pragma warning(push,3)
#endif // defined(_MSC_VER)
#include "boost/thread.hpp"
#if defined(_MSC_VER)
#pragma warning(pop)
#endif // defined(_MSC_VER)

Compilation using gcc 4.1.2, even with -Wall, does not elicit the warnings.

It's ugly, I know. We could have chosen to compile the entire translation unit,
or even project, using warning level 3, but the advantage of compiling at the
highest warning level wherever and whenever possible dictated the more focused
approach above.

Hopefully the code producing these warnings will be fixed in a near release...

Geoff Shapiro
FLIR Systems, Inc.


Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net