[date_time] strange warning

hello! try { boost::gregorian::date date_start(boost::gregorian::from_string(start)); boost::gregorian::date date_end(boost::gregorian::from_string(end)); boost::gregorian::date today(boost::gregorian::day_clock::local_day()); if(date_start > date_end || date_start < today || date_end.year() > today.year()) return false; period_=new boost::gregorian::date_period(date_start,date_end); return true; } catch(...) { return false; } .../boost/date_time/constrained_value.hpp: In member function ‘virtual bool Reservation::validation(std::string&)’: .../boost/date_time/constrained_value.hpp:64: warning: ‘year$D34041$value_’ is used uninitialized in this function .../date_time/constrained_value.hpp:64: warning: ‘year$D34041$value_’ is used uninitialized in this function why I get this warning? any idea? thanks

george wrote:
hello!
...snip details...
.../boost/date_time/constrained_value.hpp: In member function ‘virtual bool Reservation::validation(std::string&)’: .../boost/date_time/constrained_value.hpp:64: warning: ‘year$D34041$value_’ is used uninitialized in this function .../date_time/constrained_value.hpp:64: warning: ‘year$D34041$value_’ is used uninitialized in this function
why I get this warning? any idea?
The compiler is correct, it's coming from the library where it indicates -- it can be safely ignored. It's only not initialized in the error path where an exception will be thrown and the value isn't used. Jeff
participants (2)
-
george
-
Jeff Garland