[tor-bugs] #13577 [Tor]: Fix clang compilation warnings in tor, trunnel
Tor Bug Tracker & Wiki
blackhole at torproject.org
Thu Oct 30 11:43:00 UTC 2014
#13577: Fix clang compilation warnings in tor, trunnel
------------------------+------------------------------
Reporter: teor | Owner:
Type: defect | Status: needs_review
Priority: minor | Milestone:
Component: Tor | Version: Tor: unspecified
Resolution: | Keywords: clang
Actual Points: | Parent ID:
Points: |
------------------------+------------------------------
Comment (by teor):
It turns out that only macros like (A == B) trigger the error.
Adding a no-op like "| | 0" to the end of the macro breaks this pattern-
matching.
The final transformation is: (A == B) to ((A == B) | | 0) with an
appropriate comment.
The benefit of this change over the "!!" change is that it can be
performed in the macro itself. (Perhaps this also works for "!!" in the
macro? I can't remember if I checked it or not. But I think "| | 0" is
just as clear as "!!".)
The fixed branch is: silence-warnings-in-macros
It includes the trunnel and non-trunnel commit.
It also includes a very minor fix to a comment in src/or/or.h:
{{{
#define PROXY_SOCKS5 3
-/* !!!! If there is ever a PROXY_* type over 2, we must grow the
proxy_type
+/* !!!! If there is ever a PROXY_* type over 3, we must grow the
proxy_type
* field in or_connection_t */
}}}
Normally, I'd put this in its own commit and bug, but it hardly seems
worth it. (It snuck in accidentally because I fixed the typo while doing
the other changes.)
--
Ticket URL: <https://trac.torproject.org/projects/tor/ticket/13577#comment:4>
Tor Bug Tracker & Wiki <https://trac.torproject.org/>
The Tor Project: anonymity online
More information about the tor-bugs
mailing list