diff options
author | teor <teor2345@gmail.com> | 2014-10-26 14:43:55 +1100 |
---|---|---|
committer | teor <teor2345@gmail.com> | 2014-10-30 22:34:46 +1100 |
commit | 13298d90a90dc62d21d38f910171c9b57a8f0273 (patch) | |
tree | df91745009bef0a26901438d361036f039e9b00f /src/or/or.h | |
parent | acc392856d255059949bb22d2daf56c61f3fd76d (diff) | |
download | tor-13298d90a90dc62d21d38f910171c9b57a8f0273.tar.gz tor-13298d90a90dc62d21d38f910171c9b57a8f0273.zip |
Silence spurious clang warnings
Silence clang warnings under --enable-expensive-hardening, including:
+ implicit truncation of 64 bit values to 32 bit;
+ const char assignment to self;
+ tautological compare; and
+ additional parentheses around equality tests. (gcc uses these to
silence assignment, so clang warns when they're present in an
equality test. But we need to use extra parentheses in macros to
isolate them from other code).
Diffstat (limited to 'src/or/or.h')
-rw-r--r-- | src/or/or.h | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/or/or.h b/src/or/or.h index eaf609287d..6170c2119c 100644 --- a/src/or/or.h +++ b/src/or/or.h @@ -241,7 +241,7 @@ typedef enum { #define PROXY_CONNECT 1 #define PROXY_SOCKS4 2 #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 */ /* Pluggable transport proxy type. Don't use this in or_connection_t, @@ -4317,7 +4317,8 @@ static INLINE void or_state_mark_dirty(or_state_t *state, time_t when) /** Please turn this IP address into an FQDN, privately. */ #define SOCKS_COMMAND_RESOLVE_PTR 0xF1 -#define SOCKS_COMMAND_IS_CONNECT(c) ((c)==SOCKS_COMMAND_CONNECT) +/* || 0 is for -Wparentheses-equality (-Wall?) appeasement under clang */ +#define SOCKS_COMMAND_IS_CONNECT(c) (((c)==SOCKS_COMMAND_CONNECT) || 0) #define SOCKS_COMMAND_IS_RESOLVE(c) ((c)==SOCKS_COMMAND_RESOLVE || \ (c)==SOCKS_COMMAND_RESOLVE_PTR) |