From 0964b06240947e94fc2732107815fff41856d481 Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Fri, 28 Nov 2014 18:57:48 +0100 Subject: Compiler.h: add macro GCC_OLDER_THAN() --- src/util/Manual.hxx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/util') 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 #include -#if !defined(__clang__) && __GNUC__ && !GCC_CHECK_VERSION(4,8) +#if GCC_OLDER_THAN(4,8) #include #endif @@ -54,7 +54,7 @@ */ template 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 -- cgit v1.2.3 From 705b3c6b63bd41f1eefe27c8d5291e3897026238 Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Fri, 26 Dec 2014 13:37:38 +0100 Subject: util/ASCII: fix indent --- src/util/ASCII.hxx | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) (limited to 'src/util') diff --git a/src/util/ASCII.hxx b/src/util/ASCII.hxx index 19a18a1bb..cd26d9dec 100644 --- a/src/util/ASCII.hxx +++ b/src/util/ASCII.hxx @@ -43,24 +43,24 @@ gcc_pure gcc_nonnull_all static inline bool StringEqualsCaseASCII(const char *a, const char *b) { - assert(a != nullptr); - assert(b != nullptr); + assert(a != nullptr); + assert(b != nullptr); - /* 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); + assert(a != nullptr); + assert(b != nullptr); - /* 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 -- cgit v1.2.3 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/util/ASCII.hxx | 6 ++++++ src/util/UriUtil.cxx | 3 +++ 2 files changed, 9 insertions(+) (limited to 'src/util') 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 && -- cgit v1.2.3