]> git.ipfire.org Git - thirdparty/qemu.git/commit
tests/tcg: Suppress compiler false-positive warning on sha1.c
authorPeter Maydell <peter.maydell@linaro.org>
Tue, 4 Mar 2025 22:24:24 +0000 (22:24 +0000)
committerAlex Bennée <alex.bennee@linaro.org>
Mon, 10 Mar 2025 10:30:01 +0000 (10:30 +0000)
commitc05aec9d4a9cc0ab6615efad209acff6c750c40a
tree5472b93aeeed689aaccff28b43c9efeda383c5d3
parent874c712dc148142dfdaf2589d66a17391fe331f1
tests/tcg: Suppress compiler false-positive warning on sha1.c

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.maydell@linaro.org>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Message-Id: <20250227141343.1675415-1-peter.maydell@linaro.org>
[AJB: -Wno-unknown-warning-option for clang's sake]
Signed-off-by: Alex Bennée <alex.bennee@linaro.org>
Message-Id: <20250304222439.2035603-18-alex.bennee@linaro.org>
tests/tcg/aarch64/Makefile.target
tests/tcg/arm/Makefile.target
tests/tcg/hexagon/Makefile.target
tests/tcg/multiarch/Makefile.target