date_time library throwing a lot of warnings
Good day everyone,
i'm using the boost::date_time::posix_time libarary in my application.
When ever i compile i get lots of warning. mostly its about not being
able to generate copy constructors from the lexical_cast lbrary and a
whole lot of "C4127 conditional experssion is constant.
OS: windows 2000 server
Compiler: MSVC 7.1
is this normal or am i missing something here? the boost lib was
compiled with the msvc_71 toolset.
D:\boost_1_33_0\boost\lexical_cast.hpp(191) : warning C4511:
'boost::detail::lexical_stream
A Johan wrote:
Good day everyone,
i'm using the boost::date_time::posix_time libarary in my application. When ever i compile i get lots of warning. mostly its about not being able to generate copy constructors from the lexical_cast lbrary and a whole lot of "C4127 conditional experssion is constant.
OS: windows 2000 server Compiler: MSVC 7.1
is this normal or am i missing something here? the boost lib was compiled with the msvc_71 toolset.
D:\boost_1_33_0\boost\lexical_cast.hpp(191) : warning C4511: 'boost::detail::lexical_stream
' : copy constructor could not be generated with [ Target=short, Source=NewSource ] D:\boost_1_33_0\boost\lexical_cast.hpp(218) : see reference to class template instantiation 'boost::detail::lexical_stream ' being compiled with [ Target=short, Source=NewSource ] ...snip more warnings...
Hi Johan - Not sure if these warnings are normal or not -- it's entirely possible they are because we can't see warnings in the regression system (I normally don't test vc locally). The good news is that VC7.1 passes all the date-time regressions so the library should work. I'll put it on our todo list to try and track down these warnings... Jeff
Hello All....
On 25/11/05, Jeff Garland
-------------- original message snipped ----------------- Hi Johan -
Not sure if these warnings are normal or not -- it's entirely possible they are because we can't see warnings in the regression system (I normally don't test vc locally). The good news is that VC7.1 passes all the date-time regressions so the library should work. I'll put it on our todo list to try and track down these warnings...
Jeff
Jeff,
it might just be the way i'm using the boost classes that's causing
all the problems. the posix_time is a member of a class which is a
member of another class which is stored in a
vectorboost::shared_ptr. see below:
class mydata {
boost::posix_time::ptime m_timedata;
/// other members...
}
class myobject {
mydata m_data;
/// other members...
}
int main(void)
{
std::vector
On Fri, 25 Nov 2005 10:50:50 +0800, A Johan wrote
Hello All....
Jeff,
it might just be the way i'm using the boost classes that's causing all the problems. the posix_time is a member of a class which is a member of another class which is stored in a vectorboost::shared_ptr. see below:
class mydata { boost::posix_time::ptime m_timedata; /// other members... }
class myobject { mydata m_data; /// other members... } ...snip more code...
I don't think any of this should be a problem. BTW, the only place date-time uses lexical_cast is in i/o code and to/from_string functions. So if you aren't using that stuff it's probably coming from somewhere else.
consequently althought the compiler is complaining a lot about the date_time lib it may come some other libs. i'm not sure. the programs run fine but i'm concerned i may miss some of the more crucial warnings as per project i get around 200++ warnings from the boost libs and i have about 6 projects in the vc solution.
Of course you could always supress the warnings.
then again i might just be the vc71 compiler. all boost #includes need to be at the top of the file or else the compiler with give up with "Internal Compiler Error. Please call tech support...."
Well all I can say is vc71 is way better than vc6 on this -- but it's really bad when it happens.
just to make myself happy i tried doing a test program in a seperate project
int main(void) { boost::posix_time::ptime mytime(boost::posix_time::second_clock::local_time); std::cout << mytime << std::endl;
return 0; }
this compiled clean without any warnings at all.
all projects were compiled with warning level set to 4.
Right -- I doubt this code will ever invoke lexical cast. Try something like this instead: ptime t; std::istringstream iss("2005-Jan-15 10:15:03.123456789123"); iss >> t; Jeff
-----Original Message----- From: boost-users-bounces@lists.boost.org [mailto:boost-users-bounces@lists.boost.org] On Behalf Of Jeff Garland Sent: Sat 26 November 2005 03:15 To: boost-users@lists.boost.org Subject: Re: [Boost-users] date_time library throwing a lot of warnings --- snip snip -- Right -- I doubt this code will ever invoke lexical cast. Try something like this instead: ptime t; std::istringstream iss("2005-Jan-15 10:15:03.123456789123"); iss >> t; Jeff --- Heya Jeff, Sorry for the late reply. Nearly missed your email. I tried as u suggested and got loads or warnings (See attached ptime.txt). Anyways, if there's nothing major I should be concerned about I guess it should be ok. Consequently I'm trying the program_options libs and getting the same errors so maybe its something in the lexical cast libs? Wouldn't know till further investigation is done. Cheers & have a good day. Alfonso Johan -- No virus found in this outgoing message. Checked by AVG Free Edition. Version: 7.1.362 / Virus Database: 267.13.8/183 - Release Date: 25/11/2005
participants (3)
-
A Johan
-
A. Johan
-
Jeff Garland