[tor-dev] 'time_t' warnings on MSVC

Gisle Vanem gvanem at broadpark.no
Fri Jul 12 12:30:40 UTC 2013


I've been building tor myself for 2 years now. In order to reduce the
number of warnings, I've added '-D_USE_32BIT_TIME_T' to my CFLAG.
This has worked fine until I updated and built OpenSSL 4 days ago.
It's 'ASN1_time_adj()' function and related 'OPENSSL_gmtime()' just 
doesn't work when given a 32-bit 'time_t'. (Not sure how/if they worked
with a 32-bit time before). Maybe this could be detected by common/tortls.c 
before calling into OpenSSL? 

Well, tor builds and works okay w/o this define. But I wish the noise-level
from "cl.exe -W3" could be reduced. They're probably harmless now. But 
what about after the year 2036? The warnings related to 'time_'t are:

channeltls.c(1403) : warning C4244: 'function' : conversion from 'time_t' to 'long', possible loss of data
channeltls.c(1404) : warning C4244: '=' : conversion from 'time_t' to 'long', possible loss of data
directory.c(1711) : warning C4244: '=' : conversion from 'time_t' to 'long', possible loss of data
directory.c(2924) : warning C4244: '=' : conversion from 'time_t' to 'long', possible loss of data
dirserv.c(1795) : warning C4244: 'return' : conversion from 'const time_t' to 'long', possible loss of data
dirserv.c(3092) : warning C4244: '=' : conversion from 'time_t' to 'long', possible loss of data
geoip.c(1240) : warning C4244: 'initializing' : conversion from 'time_t' to 'long', possible loss of data
hibernate.c(356) : warning C4244: 'return' : conversion from 'time_t' to 'long', possible loss of data
networkstatus.c(754) : warning C4244: 'initializing' : conversion from 'time_t' to 'long', possible loss of data
networkstatus.c(1299) : warning C4244: 'initializing' : conversion from 'time_t' to 'long', possible loss of data
networkstatus.c(1329) : warning C4244: '=' : conversion from 'time_t' to 'long', possible loss of data
networkstatus.c(1337) : warning C4244: '=' : conversion from 'time_t' to 'long', possible loss of data
networkstatus.c(1846) : warning C4244: 'initializing' : conversion from 'time_t' to 'long', possible loss of data
rephist.c(189) : warning C4244: '+=' : conversion from 'time_t' to 'unsigned long', possible loss of data
rephist.c(192) : warning C4244: '+=' : conversion from 'time_t' to 'unsigned long', possible loss of data
rephist.c(213) : warning C4244: '+=' : conversion from 'time_t' to 'unsigned long', possible loss of data
rephist.c(227) : warning C4244: '+=' : conversion from 'time_t' to 'unsigned long', possible loss of data
rephist.c(333) : warning C4244: '=' : conversion from 'time_t' to 'long', possible loss of data
rephist.c(387) : warning C4244: 'initializing' : conversion from 'time_t' to 'long', possible loss of data
rephist.c(497) : warning C4244: '+=' : conversion from 'time_t' to 'long', possible loss of data
rephist.c(515) : warning C4244: '+=' : conversion from 'time_t' to 'long', possible loss of data
rephist.c(517) : warning C4244: '+=' : conversion from 'time_t' to 'long', possible loss of data
rephist.c(531) : warning C4244: 'initializing' : conversion from 'time_t' to 'long', possible loss of data
rephist.c(535) : warning C4244: '+=' : conversion from 'time_t' to 'long', possible loss of data
rephist.c(559) : warning C4244: 'return' : conversion from 'time_t' to 'long', possible loss of data
rephist.c(1053) : warning C4244: 'initializing' : conversion from 'time_t' to 'long', possible loss of data
routerlist.c(5038) : warning C4244: 'function' : conversion from 'time_t' to 'long', possible loss of data
entrynodes.c(160) : warning C4244: '=' : conversion from 'time_t' to 'long', possible loss of data

--gv




More information about the tor-dev mailing list