id,summary,reporter,owner,description,type,status,milestone,component,version,severity,resolution,keywords,cc 8696,chrono compilation error on Solaris/gcc,tmmikolajczyk@…,viboes,"The ""timegm"" function is not available on Solaris (Solaris 11) when using the gcc toolchain. It works fine for the sunpro toolchain. The ""timegm"" manual on regular linux says (man timegm): "" For a portable version of timegm(), set the TZ environment variable to UTC, call mktime(3) and restore the value of TZ. Something like #include #include time_t my_timegm(struct tm *tm) { time_t ret; char *tz; tz = getenv(""TZ""); setenv(""TZ"", """", 1); tzset(); ret = mktime(tm); if (tz) setenv(""TZ"", tz, 1); else unsetenv(""TZ""); tzset(); return ret; } "" The Boost.Chrono has its own implementation available as the internal_timegm() function, however the implementation is used only in very limited cases (currently Windows but not Cygwin env.) selected by the BOOST_CHRONO_INTERNAL_TIMEGM macrodefinition. The proposed patch enables the internal_timegm() also for Solaris/gcc. The issue concerns chrono in version 2 (BOOST_CHRONO_VERSION=2). The attached application reproduces the issue: $ g++ chrono_io_test_solaris.cpp -lboost_system -DBOOST_CHRONO_VERSION=2 In file included from boost/chrono/chrono_io.hpp:26:0, from chrono_io_test_solaris.cpp:1: boost/chrono/io/time_point_io.hpp: In function 'std::basic_istream<_CharT, _Traits>& boost::chrono::operator>>(std::basic_istream<_CharT, _Traits>&, boost::chrono::time_point&)': boost/chrono/io/time_point_io.hpp:1003:27: error: there are no arguments to 'timegm' that depend on a template parameter, so a declaration of 'timegm' must be available boost/chrono/io/time_point_io.hpp:1003:27: note: (if you use '-fpermissive', G++ will accept your code, but allowing the use of an undeclared name is deprecated) boost/chrono/io/time_point_io.hpp:1055:29: error: there are no arguments to 'timegm' that depend on a template parameter, so a declaration of 'timegm' must be available $",Bugs,closed,Boost 1.54.0,chrono,Boost Development Trunk,Problem,fixed,,