diff options
author | Sebastian Hahn <sebastian@torproject.org> | 2014-02-13 08:25:08 +0100 |
---|---|---|
committer | Nick Mathewson <nickm@torproject.org> | 2014-02-14 23:43:15 -0500 |
commit | 3f567f529f88a7430278b9a2135abb70af109bde (patch) | |
tree | 8044b2b3592eb3ba77d15acb3fa25142b464e0bf /src/common/compat.h | |
parent | d6e6eaba601d87ff18d20c1766b3f8fcac69e77f (diff) | |
download | tor-3f567f529f88a7430278b9a2135abb70af109bde.tar.gz tor-3f567f529f88a7430278b9a2135abb70af109bde.zip |
gcc/clang: Mark macro-generated functions as possible unused
clang 3.4 introduced a new by-default warning about unused static
functions, which we triggered heavily for the hashtable and map function
generating macros. We can use __attribute__ ((unused)) (thanks nickm for
the suggestion :-) ) to silence these warnings.
Diffstat (limited to 'src/common/compat.h')
-rw-r--r-- | src/common/compat.h | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/src/common/compat.h b/src/common/compat.h index 8ab7190526..51fb8c5273 100644 --- a/src/common/compat.h +++ b/src/common/compat.h @@ -162,6 +162,7 @@ extern INLINE double U64_TO_DBL(uint64_t x) { * * #define ATTR_NONNULL(x) __attribute__((nonnull x)) */ #define ATTR_NONNULL(x) +#define ATTR_UNUSED __attribute__ ((unused)) /** Macro: Evaluates to <b>exp</b> and hints the compiler that the value * of <b>exp</b> will probably be true. @@ -185,6 +186,7 @@ extern INLINE double U64_TO_DBL(uint64_t x) { #define ATTR_MALLOC #define ATTR_NORETURN #define ATTR_NONNULL(x) +#define ATTR_UNUSED #define PREDICT_LIKELY(exp) (exp) #define PREDICT_UNLIKELY(exp) (exp) #endif |