I got the following warning while compiling with (debian-testing) g++
4.0.1-2
I couldn't see the problem in the code?
/usr/local/include/boost-1_33/boost/date_time/time_duration.hpp: In
function 'time_duration
boost::date_time::parse_undelimited_time_duration(const std::string&)
[with time_duration = boost::posix_time::time_duration]':
/usr/local/include/boost-1_33/boost/date_time/time_duration.hpp:58:
warning: control may reach end of non-void function 'static typename
frac_sec_type::int_type
boost::date_time::time_resolution_traits
Paul wrote:
I got the following warning while compiling with (debian-testing) g++ 4.0.1-2
I couldn't see the problem in the code?
There may not be a problem. gcc/g++ 4.0 is more eager (too eager, in my opinion) to warn about problems in code paths for which its flow analysis can't determine reachability. If a code path is really unreachable but gcc doesn't think so, it should be possible to suppress such warnings by adding an assertion such as assert(!"This can't happen") (assuming that NDEBUG is not used).
/usr/local/include/boost-1_33/boost/date_time/time_duration.hpp: In function 'time_duration boost::date_time::parse_undelimited_time_duration(const std::string&) [with time_duration = boost::posix_time::time_duration]': /usr/local/include/boost-1_33/boost/date_time/time_duration.hpp:58: warning: control may reach end of non-void function 'static typename frac_sec_type::int_type boost::date_time::time_resolution_traits
::to_tick_count(v_type, v_type, v_type, typename frac_sec_type::int_type) [with frac_sec_type = boost::date_time::time_resolution_traits_adapted64_impl, boost::date_time::time_resolutions res = micro, typename frac_sec_type::int_type resolution_adjust = 1000000, short unsigned int frac_digits = 6u, v_type = int32_t]' being inlined
You seem to have the wrong version of the Boost source. That function is in time_parsing.hpp, not time_duration.hpp, in version 1.33. You could install the libboost-date-time-dev package from sid instead of compiling it yourself. Ben.
Ben Hutchings wrote:
Paul wrote:
/usr/local/include/boost-1_33/boost/date_time/time_duration.hpp: In function 'time_duration boost::date_time::parse_undelimited_time_duration(const std::string&) [with time_duration = boost::posix_time::time_duration]': /usr/local/include/boost-1_33/boost/date_time/time_duration.hpp:58: warning: control may reach end of non-void function 'static typename frac_sec_type::int_type boost::date_time::time_resolution_traits
::to_tick_count(v_type, v_type, v_type, typename frac_sec_type::int_type) [with frac_sec_type = boost::date_time::time_resolution_traits_adapted64_impl, boost::date_time::time_resolutions res = micro, typename frac_sec_type::int_type resolution_adjust = 1000000, short unsigned int frac_digits = 6u, v_type = int32_t]' being inlined You seem to have the wrong version of the Boost source. That function is in time_parsing.hpp, not time_duration.hpp, in version 1.33. You could install the libboost-date-time-dev package from sid instead of compiling it yourself.
Ben.
i have to compile it myself as i need to define BOOST_SIGNALS_NAMESPACE=signalslib (for boost_signals), as I use it in conjunction with the QT library. So i compile the whole thing for myself. and I am a bit concerned about your "wrong version" comment. I've checked, This code and this warning came out of the latest 1.33 tar.bz2. I've confirmed it. I think the error message is confusing: - to_tick_count is inlined in time_duration.hpp (the error line) - its inlined in the constructor for time_duration - time_duration is constructed in time_parsing.hpp - to_tick_count is in yet another file. the error message only mentions the time_duration.hpp. weird, eh? Paul
On Wed, 17 Aug 2005 15:24:59 +0100, Ben Hutchings wrote
Paul wrote:
I got the following warning while compiling with (debian-testing) g++ 4.0.1-2
I couldn't see the problem in the code?
There may not be a problem. gcc/g++ 4.0 is more eager (too eager, in my opinion) to warn about problems in code paths for which its flow analysis can't determine reachability.
In fact, if you look at the function it is warning about it has the following structure: static tick_type to_tick_count(...) { if(...) { return /...; } else{ return /... } } That's clearly a compiler bug that should be reported to the gcc folks. Jeff
participants (3)
-
Ben Hutchings
-
Jeff Garland
-
Paul