
----- Original Message ----- From: "Howard Hinnant" <howard.hinnant@gmail.com> To: <boost@lists.boost.org> Sent: Friday, December 11, 2009 6:21 PM Subject: Re: [boost] [chrono] New Features + Bug fixes + Updateddocumentation
On Dec 11, 2009, at 12:04 PM, vicente.botet wrote:
Hi, ----- Original Message ----- From: "Howard Hinnant" <howard.hinnant@gmail.com> To: <boost@lists.boost.org> Sent: Friday, December 11, 2009 5:20 PM Subject: Re: [boost] [chrono] New Features + Bug fixes + Updateddocumentation
On Dec 11, 2009, at 3:37 AM, vicente.botet wrote:
There is yet an error with gcc-4.4.0
./boost/chrono/chrono.hpp:945: error: declaration of 'typedef class boost::chrono::duration<long long int, boost::ratio<1ll, 10000000ll> > boost::chrono::system_clock::duration' ./boost/chrono/chrono.hpp:458: error: changes meaning of 'duration' from 'class boost::chrono::duration<long long int, boost::ratio<1ll, 10000000ll> >'
Note that the line numbers will be no more significant. It corresponds to the following
namespace chrono {
template <class Rep, class Period> class duration {...}
class BOOST_CHRONO_DECL system_clock { public: typedef BOOST_SYSTEM_CLOCK_DURATION duration; ... }; }
where
#ifdef BOOST_CHRONO_WINDOWS_API // The system_clock tick is 100 nanoseconds # define BOOST_SYSTEM_CLOCK_DURATION duration<boost::int_least64_t, ratio<BOOST_INTMAX_C(1), BOOST_INTMAX_C(10000000)> > #else # define BOOST_SYSTEM_CLOCK_DURATION boost::chrono::nanoseconds #endif
Try qualifying "duration" with "chrono::" in BOOST_SYSTEM_CLOCK_DURATION:
# define BOOST_SYSTEM_CLOCK_DURATION chrono::duration<boost::int_least64_t, ...
This could help if the warning was for windows API, but unfortunately it was reported be gcc-4.4.0 and also by gcc-4.3.4 :(
Try a preprocess (-E) and make sure system_clock looks the way you think it should. This could be a configuration error. I just copy/pasted your sandbox chrono.hpp into a test file and compiled it fine using gcc-4.4.0.
Oh, I see. Tom Tam could be building on MinGW with gcc-4.4.0. I have sent him a mail to request your suggestion. BTW, gcc-4.3.4 didn't had the error on cygwin. Thanks, Vicente P.S. I think that I will need to install MinGW on my PC.