diff options
author | Max Kellermann <max@duempel.org> | 2014-12-26 14:28:01 +0100 |
---|---|---|
committer | Max Kellermann <max@duempel.org> | 2014-12-26 14:34:03 +0100 |
commit | 95f84afd338a9333b2fcf05dc171ce1dad6fbe7c (patch) | |
tree | a97ed33aed26dc814f78ff31fab44cbe4d14848e /src/fs/Traits.hxx | |
parent | 9f7fd1fbfb0e351d42657b1094c34b0f2233ef6c (diff) |
fs/Traits, ...: work around -Wtautological-pointer-compare
New in clang 3.6.
Diffstat (limited to 'src/fs/Traits.hxx')
-rw-r--r-- | src/fs/Traits.hxx | 16 |
1 files changed, 16 insertions, 0 deletions
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; |