diff --git a/configure.ac b/configure.ac index 76ba7f522fb..05d6bad496b 100644 --- a/configure.ac +++ b/configure.ac @@ -853,7 +853,7 @@ AS_IF([test "x${has_optimizer_flags}" = "xno"], ] ) -AS_IF([test "x$ac_cv_c_compiler_version" = "x17"], [NO_WARN_CAST_FUNCTION_TYPE_MISMATCH="-Wno-cast-function-type-mismatch"], [NO_WARN_CAST_FUNCTION_TYPE_MISMATCH=""]) +AS_IF([test -n "$ac_cv_c_compiler_version" && test "$ac_cv_c_compiler_version" -ge 17 2>/dev/null], [NO_WARN_CAST_FUNCTION_TYPE_MISMATCH="-Wno-cast-function-type-mismatch"], [NO_WARN_CAST_FUNCTION_TYPE_MISMATCH=""]) AC_SUBST([NO_WARN_CAST_FUNCTION_TYPE_MISMATCH]) case $host_os_def in diff --git a/include/tscore/CryptoHash.h b/include/tscore/CryptoHash.h index 767cb7b64fe..5baaac95a87 100644 --- a/include/tscore/CryptoHash.h +++ b/include/tscore/CryptoHash.h @@ -44,7 +44,7 @@ union CryptoHash { uint8_t u8[CRYPTO_HASH_SIZE / sizeof(uint8_t)]; /// Default constructor - init to zero. - CryptoHash() { memset(this, 0, sizeof(*this)); } + CryptoHash() { memset(static_cast(this), 0, sizeof(*this)); } /// Copy constructor. CryptoHash(CryptoHash const &that) = default; @@ -53,7 +53,7 @@ union CryptoHash { operator=(CryptoHash const &that) { if (this != &that) { - memcpy(this, &that, sizeof(*this)); + memcpy(static_cast(this), &that, sizeof(*this)); } return *this; } diff --git a/include/tscpp/util/TextView.h b/include/tscpp/util/TextView.h index 41ce08a25dd..79bf10c23d9 100644 --- a/include/tscpp/util/TextView.h +++ b/include/tscpp/util/TextView.h @@ -1263,7 +1263,7 @@ namespace literals * rather bizarre to me, but there it is. Update: this depends on the version of the compiler, * so hopefully someday this can be removed. */ - constexpr ts::TextView operator"" _tv(const char *s, size_t n) { return {s, n}; } + constexpr ts::TextView operator""_tv(const char *s, size_t n) { return {s, n}; } } // namespace literals /** Functor for STL containers that need caseless comparisons of standard string types. @@ -1346,7 +1346,7 @@ template <> struct iterator_traits { // // I couldn't think of any better place to put this, so it's here. At least @c TextView is strongly related // to @c std::string_view. -constexpr std::string_view operator"" _sv(const char *s, size_t n) +constexpr std::string_view operator""_sv(const char *s, size_t n) { return {s, n}; } diff --git a/src/traffic_server/HostStatus.cc b/src/traffic_server/HostStatus.cc index 0449aeb0a67..fb47fc802f6 100644 --- a/src/traffic_server/HostStatus.cc +++ b/src/traffic_server/HostStatus.cc @@ -269,7 +269,7 @@ HostStatus::setHostStatus(const std::string_view name, TSHostStatus status, cons host_stat = it->second; } else { host_stat = static_cast(ats_malloc(sizeof(HostStatRec))); - bzero(host_stat, sizeof(HostStatRec)); + bzero(static_cast(host_stat), sizeof(HostStatRec)); hosts_statuses.emplace(name, host_stat); } if (reason & Reason::ACTIVE) {