[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]
Re: [tor-bugs] #11633 [Tor]: Quench a few warnings found with gcc-4.2 and clang
#11633: Quench a few warnings found with gcc-4.2 and clang
------------------------+--------------------------------
Reporter: _x3j11 | Owner:
Type: defect | Status: needs_revision
Priority: normal | Milestone: Tor: 0.2.5.x-final
Component: Tor | Version:
Resolution: | Keywords: tor-client build
Actual Points: | Parent ID:
Points: |
------------------------+--------------------------------
Changes (by nickm):
* keywords: => tor-client build
* status: new => needs_revision
Comment:
Thanks for the patches!
Should the CONST_TO_* functions return a const pointer?
I worry about the time_t patch on platforms like 32-bit NetBSD where long
is 32 bit but time_t is 64-bit. On those platforms, it's safe to do:
{{{
time_t now = time(NULL);
long one_hour = 3600;
time_t in_an_hour = now + one_hour;
}}}
but it isn't safe to do:
{{{
time_t now = time(NULL);
long one_hour = 3600;
time_t in_an_hour = (time_t)((long)now + one_hour);
}}}
In other words, the code ought to handle sizeof(time_t) < sizeof(long)
[the OpenBSD case] as well as sizeof(time_t) > sizeof(long) [the NetBSD
case].
--
Ticket URL: <https://trac.torproject.org/projects/tor/ticket/11633#comment:1>
Tor Bug Tracker & Wiki <https://trac.torproject.org/>
The Tor Project: anonymity online
_______________________________________________
tor-bugs mailing list
tor-bugs@xxxxxxxxxxxxxxxxxxxx
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-bugs