From 53f40448901ffe0d953c81939d031c63cdf3779a Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Fri, 26 Dec 2014 13:40:17 +0100 Subject: util/{ASCII,UriUtil}, ...: work around -Wtautological-pointer-compare New in clang 3.6. --- src/fs/Charset.cxx | 6 ++++++ src/fs/Traits.cxx | 6 ++++++ 2 files changed, 12 insertions(+) (limited to 'src/fs') diff --git a/src/fs/Charset.cxx b/src/fs/Charset.cxx index dad5779f9..0b598ef46 100644 --- a/src/fs/Charset.cxx +++ b/src/fs/Charset.cxx @@ -79,7 +79,10 @@ GetFSCharset() std::string PathToUTF8(const char *path_fs) { +#if !CLANG_CHECK_VERSION(3,6) + /* disabled on clang due to -Wtautological-pointer-compare */ assert(path_fs != nullptr); +#endif if (fs_charset.empty()) return std::string(path_fs); @@ -109,7 +112,10 @@ PathToUTF8(const char *path_fs) char * PathFromUTF8(const char *path_utf8) { +#if !CLANG_CHECK_VERSION(3,6) + /* disabled on clang due to -Wtautological-pointer-compare */ assert(path_utf8 != nullptr); +#endif if (fs_charset.empty()) return g_strdup(path_utf8); diff --git a/src/fs/Traits.cxx b/src/fs/Traits.cxx index 2c3ce075b..47cb5aee3 100644 --- a/src/fs/Traits.cxx +++ b/src/fs/Traits.cxx @@ -25,7 +25,10 @@ const char * PathTraits::GetBaseUTF8(const char *p) { +#if !CLANG_CHECK_VERSION(3,6) + /* disabled on clang due to -Wtautological-pointer-compare */ assert(p != nullptr); +#endif const char *slash = strrchr(p, SEPARATOR_UTF8); return slash != nullptr @@ -36,7 +39,10 @@ PathTraits::GetBaseUTF8(const char *p) std::string PathTraits::GetParentUTF8(const char *p) { +#if !CLANG_CHECK_VERSION(3,6) + /* disabled on clang due to -Wtautological-pointer-compare */ assert(p != nullptr); +#endif const char *slash = strrchr(p, SEPARATOR_UTF8); return slash != nullptr -- cgit v1.2.3 From 95f84afd338a9333b2fcf05dc171ce1dad6fbe7c Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Fri, 26 Dec 2014 14:28:01 +0100 Subject: fs/Traits, ...: work around -Wtautological-pointer-compare New in clang 3.6. --- src/fs/Traits.hxx | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) (limited to 'src/fs') diff --git a/src/fs/Traits.hxx b/src/fs/Traits.hxx index 77317e1ee..1af8f8672 100644 --- a/src/fs/Traits.hxx +++ b/src/fs/Traits.hxx @@ -57,7 +57,11 @@ struct PathTraitsFS { gcc_pure gcc_nonnull_all static const_pointer FindLastSeparator(const_pointer p) { +#if !CLANG_CHECK_VERSION(3,6) + /* disabled on clang due to -Wtautological-pointer-compare */ assert(p != nullptr); +#endif + #ifdef WIN32 const_pointer pos = p + GetLength(p); while (p != pos && !IsSeparator(*pos)) @@ -77,7 +81,11 @@ struct PathTraitsFS { gcc_pure gcc_nonnull_all static bool IsAbsolute(const_pointer p) { +#if !CLANG_CHECK_VERSION(3,6) + /* disabled on clang due to -Wtautological-pointer-compare */ assert(p != nullptr); +#endif + #ifdef WIN32 if (IsDrive(p) && IsSeparator(p[2])) return true; @@ -147,7 +155,11 @@ struct PathTraitsUTF8 { gcc_pure gcc_nonnull_all static const_pointer FindLastSeparator(const_pointer p) { +#if !CLANG_CHECK_VERSION(3,6) + /* disabled on clang due to -Wtautological-pointer-compare */ assert(p != nullptr); +#endif + return strrchr(p, SEPARATOR); } @@ -160,7 +172,11 @@ struct PathTraitsUTF8 { gcc_pure gcc_nonnull_all static bool IsAbsolute(const_pointer p) { +#if !CLANG_CHECK_VERSION(3,6) + /* disabled on clang due to -Wtautological-pointer-compare */ assert(p != nullptr); +#endif + #ifdef WIN32 if (IsDrive(p) && IsSeparator(p[2])) return true; -- cgit v1.2.3