On 28 Jan 2017, at 14:45, grarpamp grarpamp@gmail.com wrote:
Ancient gcc says
Thanks for this bug report.
Which platform(s) do these warnings occur on?
I tested on macOS 10.12 with gcc 4.9 and Linux 4.4 with gcc 4.7, and neither were affected by these errors, so it does appear to be an ancient compiler issue.
src/or/connection.c:1843: warning: passing argument 1 of 'TO_OR_CONN' discards qualifiers from pointer target type src/or/connection.c:1843: warning: passing argument 1 of 'TO_OR_CONN' discards qualifiers from pointer target type
These are harmless: the code is correct, and has the correct casts.
src/test/test_dir.c:3700: warning: assuming signed overflow does not occur when assuming that (X - c) >= X is always true src/test/test_dir.c:3828: warning: assuming signed overflow does not occur when assuming that (X - c) >= X is always true
These appear to be a compiler bug, (X - c) >= X is always *false* given that assumption, and the code describes an underflow.
In any case, these unit tests are correct: current_time will always be much greater than -1, so there will be no underflow.
If this affects newer compilers, I would be happy to log a bug for it.
src/test/vote_descriptors.inc:93: warning: string length '4135' is greater than the length '4095' ISO C99 compilers are required to support src/test/test_microdesc.c:654: warning: string length '5844' is greater than the length '4095' ISO C99 compilers are required to support src/test/test_descriptors.inc:305: warning: string length '10571' is greater than the length '4095' ISO C99 compilers are required to support
We pass supported compilers an option that disables this warning. Perhaps gcc 4.2.1 does not have it.
T
-- Tim Wilson-Brown (teor)
teor2345 at gmail dot com PGP C855 6CED 5D90 A0C5 29F6 4D43 450C BA7F 968F 094B ricochet:ekmygaiu4rzgsk6n xmpp: teor at torproject dot org ------------------------------------------------------------------------