From 0200037a5a058650cb2e2e2cca1545a362e52013 Mon Sep 17 00:00:00 2001 From: James Zern Date: Thu, 6 Apr 2023 11:49:44 -0700 Subject: [PATCH] row_any,ANYDETILE: fix -Wmemset-elt-size warning MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit under gcc 12.2.0 using -Wall: source/row_any.cc: In function ‘void libyuv::DetileRow_16_Any_SSE2(const uint16_t*, ptrdiff_t, uint16_t*, int)’: source/row_any.cc:2287:11: warning: ‘memset’ used with length equal to number of elements without multiplication by element size [-Wmemset-elt-size] 2287 | memset(temp, 0, 16 * BPP); /* for msan */ | ~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~ source/row_any.cc:2308:1: note: in expansion of macro ‘ANYDETILE’ 2308 | ANYDETILE(DetileRow_16_Any_SSE2, DetileRow_16_SSE2, uint16_t, 2, 15) This increases the memset to the full buffer size, which may not be strictly necessary. Change-Id: Iea2fc649990ee84ea9aa8020d6f6b25e012b18fb Reviewed-on: https://chromium-review.googlesource.com/c/libyuv/libyuv/+/4406599 Reviewed-by: Frank Barchard --- source/row_any.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/source/row_any.cc b/source/row_any.cc index 0168061ff..9d33a294a 100644 --- a/source/row_any.cc +++ b/source/row_any.cc @@ -2284,7 +2284,7 @@ ANY11S(AYUVToVURow_Any_NEON, AYUVToVURow_NEON, 0, 4, 15) #define ANYDETILE(NAMEANY, ANY_SIMD, T, BPP, MASK) \ void NAMEANY(const T* src, ptrdiff_t src_tile_stride, T* dst, int width) { \ SIMD_ALIGNED(T temp[16 * 2]); \ - memset(temp, 0, 16 * BPP); /* for msan */ \ + memset(temp, 0, sizeof(temp)); /* for msan */ \ int r = width & MASK; \ int n = width & ~MASK; \ if (n > 0) { \