VC 7.1 level 4 warnings (thread, lexical_cast)

[Should this really go to boost.users instead?] Hi, loads of warnings are generated when compiling code with VC 7.1 using Boost.Thread and lexical_cast with the warning level set to 4. I use Boost 1.31.0, but at a quick look at the latest versions they seem to have the same problem * Boost.Thread generates numerous C4275 and C4251 (both related to dll-interface), examples: --- ../../../deps\boost\boost\thread\exceptions.hpp(29) : warning C4275: non dll-interface class 'std::logic_error' used as base for dll-interface class 'boost::lock_error' d:\VS.NET_2003\Vc7\include\stdexcept(14) : see declaration of 'std::logic_error' ../../../deps\boost\boost\thread\thread.hpp(78) : warning C4251: 'boost::thread_group::m_threads' : class 'std::list<_Ty>' needs to have dll-interface to be used by clients of class 'boost::thread_group' --- * lexical_cast generates C4511, C4512 + C4127, examples: -- ../../../deps\boost\boost\lexical_cast.hpp(180) : warning C4512: 'boost::detail::lexical_stream<Target,Source>' : assignment operator could not be generated ... ../../../deps\boost\boost\lexical_cast.hpp(180) : warning C4511: 'boost::detail::lexical_stream<Target,Source>' : copy constructor could not be generated ... ../../../deps\boost\boost\lexical_cast.hpp(133) : warning C4127: conditional expression is constant --- Would it be possible to get rid of those using pragmas in the header files? I wouldn't mind disabling C4511/4512 globally but the other ones I'd prefer not to. Selectively disabling the other warnings when including the files is practically impossible. I guess this has been discussed before, but why not compile with warning level 4 + warnings as errors by default? // Johan

and: ..\..\..\deps\boost\boost\lexical_cast.hpp(191) : warning C4701: local variable 'result' may be used without having been initialized // Johan

Johan Nilsson writes:
[Should this really go to boost.users instead?]
This list is fine and is probably more appropriate for this particular posting.
Hi,
loads of warnings are generated when compiling code with VC 7.1 using Boost.Thread and lexical_cast with the warning level set to 4. I use Boost 1.31.0, but at a quick look at the latest versions they seem to have the same problem
[snip warnings]
Would it be possible to get rid of those using pragmas in the header files? I wouldn't mind disabling C4511/4512 globally but the other ones I'd prefer not to. Selectively disabling the other warnings when including the files is practically impossible.
Johan, I'm afraid if you want to fix this, you have to submit a patch.
I guess this has been discussed before, but why not compile with warning level 4 + warnings as errors by default?
IIRC, too much hassle with little benefit. You can search the archives for the past discussions on the topic. -- Aleksey Gurtovoy MetaCommunications Engineering

As I have said before, I disagree with this - I think it is easy and worthwhile to steadily work at fixing these warnings. And I also note that there was an deficiency in lexical cast which, AFAIK as not been fixed. We don't seem to have the mecahnism for maintenance working as well as initial review, if the original author loses interest - an increasing problem? Paul Paul A Bristow Prizet Farmhouse, Kendal, Cumbria UK LA8 8AB +44 1539 561830 +44 7714 330204 mailto: pbristow@hetp.u-net.com | -----Original Message----- | From: boost-bounces@lists.boost.org | [mailto:boost-bounces@lists.boost.org] On Behalf Of Aleksey Gurtovoy | Sent: 31 July 2004 11:41 | To: boost@lists.boost.org | Subject: Re: [boost] VC 7.1 level 4 warnings (thread, lexical_cast) | | Johan Nilsson writes: | > [Should this really go to boost.users instead?] | | This list is fine and is probably more appropriate for this particular | posting. | | > | > Hi, | > | > loads of warnings are generated when compiling code with VC 7.1 | > using Boost.Thread and lexical_cast with the warning level set to | > 4. I use Boost 1.31.0, but at a quick look at the latest versions | > they seem to have the same problem | | [snip warnings] | | > Would it be possible to get rid of those using pragmas in the header | > files? I wouldn't mind disabling C4511/4512 globally but the other | > ones I'd prefer not to. Selectively disabling the other warnings | > when including the files is practically impossible. | | Johan, I'm afraid if you want to fix this, you have to submit a patch. | | > | > I guess this has been discussed before, but why not compile with | > warning level 4 + warnings as errors by default? | | IIRC, too much hassle with little benefit. You can search the archives | for the past discussions on the topic. | | -- | Aleksey Gurtovoy | MetaCommunications Engineering | | _______________________________________________ | Unsubscribe & other changes: | http://lists.boost.org/mailman/listinfo.cgi/boost | |
participants (3)
-
Aleksey Gurtovoy
-
Johan Nilsson
-
Paul A Bristow