On 2/27/25 06:13, Peter Maydell wrote:
GCC versions at least 12 through 15 incorrectly report a warning
about code in sha1.c:

tests/tcg/multiarch/sha1.c:161:13: warning: ‘SHA1Transform’ reading 64 bytes 
from a region of size 0 [-Wstringop-overread]
   161 |             SHA1Transform(context->state, &data[i]);
       |             ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

This is a piece of stock library code for doing SHA1 which we've
simply copied, rather than writing ourselves. The bug has been
reported to upstream GCC (about a different library's use of this
code):
  https://gcc.gnu.org/bugzilla/show_bug.cgi?id=106709

For our test case, since this isn't our original code and there isn't
actually a bug in it, suppress the incorrect warning rather than
trying to modify the code to work around the compiler issue.

Resolves:https://gitlab.com/qemu-project/qemu/-/issues/2328
Signed-off-by: Peter Maydell<peter.mayd...@linaro.org>
---
  tests/tcg/aarch64/Makefile.target   | 3 ++-
  tests/tcg/arm/Makefile.target       | 3 ++-
  tests/tcg/multiarch/Makefile.target | 8 ++++++++
  3 files changed, 12 insertions(+), 2 deletions(-)

Reviewed-by: Richard Henderson <richard.hender...@linaro.org>

r~

Reply via email to