From 05cc38bb681d6bf5a9062cd38a67f23261fa9005 Mon Sep 17 00:00:00 2001 From: Mike Blumenkrantz Date: Mon, 28 Jul 2025 11:35:38 -0400 Subject: [PATCH] vulkan: silence typed_memcpy -Waddress warnings Reviewed-by: Lionel Landwerlin Part-of: --- src/vulkan/util/vk_util.h | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/vulkan/util/vk_util.h b/src/vulkan/util/vk_util.h index 7254871e455..c9caae1b162 100644 --- a/src/vulkan/util/vk_util.h +++ b/src/vulkan/util/vk_util.h @@ -308,8 +308,10 @@ struct vk_pipeline_cache_header { #define typed_memcpy(dest, src, count) do { \ STATIC_ASSERT(sizeof(*(src)) == sizeof(*(dest))); \ - if ((dest) != NULL && (src) != NULL && (count) > 0) { \ - memcpy((dest), (src), (count) * sizeof(*(src))); \ + uint8_t *d = (uint8_t*)(dest); \ + const uint8_t *s = (const uint8_t*)(src); \ + if (d != NULL && s != NULL && (count) > 0) { \ + memcpy(d, s, (count) * sizeof(*(src))); \ } \ } while (0)