From 83e11b5fc42ef5bbb7d0226c672e83f58021869e Mon Sep 17 00:00:00 2001 From: Volker Hilsheimer Date: Sun, 20 Mar 2022 13:15:34 +0100 Subject: [PATCH] Fix build with latest Apple clang version Building with Apple clang 13.1.6.13160021 (from command line tools 13.3) results in qhash.cpp:754:39: error: passing 16-byte aligned argument to 32-byte aligned parameter 3 of 'operator()' may result in an unaligned pointer access [-Werror,-Walign-mismatch] hash2x32bytes(state0, state1, src, src + 1); ^ Help the compiler with deducing the right type for 'src' and 'srcend'. Also makes 'src' const explicitly. Change-Id: Id14a034f0fa4c2a002d9b37729d803a50a0e5e9c Reviewed-by: Thiago Macieira --- src/corelib/tools/qhash.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/corelib/tools/qhash.cpp b/src/corelib/tools/qhash.cpp index ec804da96ec..6ee0dc46705 100644 --- a/src/corelib/tools/qhash.cpp +++ b/src/corelib/tools/qhash.cpp @@ -744,8 +744,8 @@ aeshash256_ge32(__m256i state0, const uchar *p, size_t len) state1 = _mm256_aesenc_epi128(state1, state1); }; - auto src = reinterpret_cast(p); - const auto srcend = reinterpret_cast(p + len); + const __m256i *src = reinterpret_cast(p); + const __m256i *srcend = reinterpret_cast(p + len); __m256i state1 = _mm256_aesenc_epi128(state0, mm256_set1_epz(len));