aboutsummaryrefslogtreecommitdiffstats
path: root/src/util
diff options
context:
space:
mode:
authorMax Kellermann <max@duempel.org>2014-12-26 13:40:17 +0100
committerMax Kellermann <max@duempel.org>2014-12-26 13:43:32 +0100
commit53f40448901ffe0d953c81939d031c63cdf3779a (patch)
tree9007d66ae6b1a9b58efbff6fa8db80df0a206b13 /src/util
parenta5049136ffe020cd17109985e697fe2e8e1a18d5 (diff)
downloadmpd-53f40448901ffe0d953c81939d031c63cdf3779a.tar.gz
mpd-53f40448901ffe0d953c81939d031c63cdf3779a.tar.xz
mpd-53f40448901ffe0d953c81939d031c63cdf3779a.zip
util/{ASCII,UriUtil}, ...: work around -Wtautological-pointer-compare
New in clang 3.6.
Diffstat (limited to 'src/util')
-rw-r--r--src/util/ASCII.hxx6
-rw-r--r--src/util/UriUtil.cxx3
2 files changed, 9 insertions, 0 deletions
diff --git a/src/util/ASCII.hxx b/src/util/ASCII.hxx
index cd26d9dec..9f7147338 100644
--- a/src/util/ASCII.hxx
+++ b/src/util/ASCII.hxx
@@ -43,8 +43,11 @@ gcc_pure gcc_nonnull_all
static inline bool
StringEqualsCaseASCII(const char *a, const char *b)
{
+#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 */
@@ -55,8 +58,11 @@ gcc_pure gcc_nonnull_all
static inline bool
StringEqualsCaseASCII(const char *a, const char *b, size_t n)
{
+#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 */
diff --git a/src/util/UriUtil.cxx b/src/util/UriUtil.cxx
index 1783fbca5..6dd5a42e1 100644
--- a/src/util/UriUtil.cxx
+++ b/src/util/UriUtil.cxx
@@ -128,8 +128,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 &&