tests/tcg: Do not use inttypes.h in multiarch/system/memory.c
authorIlya Leoshkevich <iii@linux.ibm.com>
Thu, 10 Oct 2024 08:58:55 +0000 (10:58 +0200)
committerRichard Henderson <richard.henderson@linaro.org>
Tue, 24 Dec 2024 15:32:50 +0000 (07:32 -0800)
commit0ccbac336b74c3006d4234bb6b5c4b3c32c61171
tree30c33d018a5b4b69f8dc37ce2043dc841dd41e91
parentaa3a285b5bc56a4208b3b57d4a55291e9c260107
tests/tcg: Do not use inttypes.h in multiarch/system/memory.c

make check-tcg fails on Fedora with the following error message:

    alpha-linux-gnu-gcc [...] qemu/tests/tcg/multiarch/system/memory.c -o memory [...]
    qemu/tests/tcg/multiarch/system/memory.c:17:10: fatal error: inttypes.h: No such file or directory
       17 | #include <inttypes.h>
          |          ^~~~~~~~~~~~
    compilation terminated.

The reason is that Fedora has cross-compilers, but no cross-glibc
headers. Fix by hardcoding the format specifiers and dropping the
include.

An alternative fix would be to introduce a configure check for
inttypes.h. But this would make it impossible to use Fedora
cross-compilers for softmmu tests, which used to work so far.

Fixes: ecbcc9ead2f8 ("tests/tcg: add a system test to check memory instrumentation")
Signed-off-by: Ilya Leoshkevich <iii@linux.ibm.com>
Reviewed-by: Paolo Bonzini <pbonzini@redhat.com>
Message-ID: <20241010085906.226249-1-iii@linux.ibm.com>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
tests/tcg/multiarch/system/memory.c