util/{ASCII,UriUtil}, ...: work around -Wtautological-pointer-compare

New in clang 3.6.
This commit is contained in:
Max Kellermann
2014-12-26 13:40:17 +01:00
parent a5049136ff
commit 53f4044890
11 changed files with 52 additions and 0 deletions

View File

@@ -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 */

View File

@@ -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 &&