diff options
author | Max Kellermann <max@duempel.org> | 2014-12-26 14:26:31 +0100 |
---|---|---|
committer | Max Kellermann <max@duempel.org> | 2014-12-26 14:28:52 +0100 |
commit | 940cab8620428f21e6d0c9f4b11893b1f44ce610 (patch) | |
tree | 9b4771f1fce4e0e95f1507f021aa7587b7ba366d /src/util | |
parent | 5b84c99d793bf9b78cf28b462593775c32a3ce83 (diff) | |
parent | 665031467a55a32be306191514ac81f73ac41de7 (diff) | |
download | mpd-940cab8620428f21e6d0c9f4b11893b1f44ce610.tar.gz mpd-940cab8620428f21e6d0c9f4b11893b1f44ce610.tar.xz mpd-940cab8620428f21e6d0c9f4b11893b1f44ce610.zip |
Merge branch 'v0.18.x' into v0.19.x
Diffstat (limited to 'src/util')
-rw-r--r-- | src/util/ASCII.hxx | 26 | ||||
-rw-r--r-- | src/util/Manual.hxx | 4 | ||||
-rw-r--r-- | src/util/UriUtil.cxx | 3 |
3 files changed, 21 insertions, 12 deletions
diff --git a/src/util/ASCII.hxx b/src/util/ASCII.hxx index 19a18a1bb..9f7147338 100644 --- a/src/util/ASCII.hxx +++ b/src/util/ASCII.hxx @@ -43,24 +43,30 @@ gcc_pure gcc_nonnull_all static inline bool StringEqualsCaseASCII(const char *a, const char *b) { - assert(a != nullptr); - assert(b != nullptr); +#if !CLANG_CHECK_VERSION(3,6) + /* disabled on clang due to -Wtautological-pointer-compare */ + assert(a != nullptr); + assert(b != nullptr); +#endif - /* note: strcasecmp() depends on the locale, but for ASCII-only - strings, it's safe to use */ - return strcasecmp(a, b) == 0; + /* note: strcasecmp() depends on the locale, but for ASCII-only + strings, it's safe to use */ + return strcasecmp(a, b) == 0; } gcc_pure gcc_nonnull_all static inline bool StringEqualsCaseASCII(const char *a, const char *b, size_t n) { - assert(a != nullptr); - assert(b != nullptr); +#if !CLANG_CHECK_VERSION(3,6) + /* disabled on clang due to -Wtautological-pointer-compare */ + assert(a != nullptr); + assert(b != nullptr); +#endif - /* note: strcasecmp() depends on the locale, but for ASCII-only - strings, it's safe to use */ - return strncasecmp(a, b, n) == 0; + /* note: strcasecmp() depends on the locale, but for ASCII-only + strings, it's safe to use */ + return strncasecmp(a, b, n) == 0; } #endif diff --git a/src/util/Manual.hxx b/src/util/Manual.hxx index baab0a555..75cffac06 100644 --- a/src/util/Manual.hxx +++ b/src/util/Manual.hxx @@ -35,7 +35,7 @@ #include <new> #include <utility> -#if !defined(__clang__) && __GNUC__ && !GCC_CHECK_VERSION(4,8) +#if GCC_OLDER_THAN(4,8) #include <type_traits> #endif @@ -54,7 +54,7 @@ */ template<class T> class Manual { -#if !defined(__clang__) && __GNUC__ && !GCC_CHECK_VERSION(4,8) +#if GCC_OLDER_THAN(4,8) /* no alignas() on gcc < 4.8: apply worst-case fallback */ __attribute__((aligned(8))) #else diff --git a/src/util/UriUtil.cxx b/src/util/UriUtil.cxx index 62977e91b..54d0ded77 100644 --- a/src/util/UriUtil.cxx +++ b/src/util/UriUtil.cxx @@ -140,8 +140,11 @@ uri_remove_auth(const char *uri) bool uri_is_child(const char *parent, const char *child) { +#if !CLANG_CHECK_VERSION(3,6) + /* disabled on clang due to -Wtautological-pointer-compare */ assert(parent != nullptr); assert(child != nullptr); +#endif const size_t parent_length = strlen(parent); return memcmp(parent, child, parent_length) == 0 && |