diff options
author | Nick Mathewson <nickm@torproject.org> | 2016-02-22 14:07:58 -0500 |
---|---|---|
committer | Nick Mathewson <nickm@torproject.org> | 2016-02-23 14:05:34 -0500 |
commit | 67e5d49d8a995c6d3b8bf4177046271a7d4dd157 (patch) | |
tree | fa936203f3dd47a2240ed9281458fa5020649320 /src | |
parent | be6174f8f6aaaf8f990eb56c5cba16bc5ec0fcea (diff) | |
download | tor-67e5d49d8a995c6d3b8bf4177046271a7d4dd157.tar.gz tor-67e5d49d8a995c6d3b8bf4177046271a7d4dd157.zip |
Make clang asan work with FORTIFIED_SOURCE again.
Short version: clang asan hates the glibc strcmp macro in
bits/string2.h if you are passing it a constant string argument of
length two or less. (I could be off by one here, but that's the
basic idea.)
Closes issue 14821.
Diffstat (limited to 'src')
-rw-r--r-- | src/common/compat.h | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/src/common/compat.h b/src/common/compat.h index c7c468c754..66cc079259 100644 --- a/src/common/compat.h +++ b/src/common/compat.h @@ -42,6 +42,15 @@ #include <netinet6/in6.h> #endif +#if defined(__has_feature) +# if __has_feature(address_sanitizer) +/* Some of the fancy glibc strcmp() macros include references to memory that + * clang rejects because it is off the end of a less-than-3. Clang hates this, + * even though those references never actually happen. */ +# undef strcmp +# endif +#endif + #include <stdio.h> #include <errno.h> |