tests/tcg: Do not use inttypes.h in multiarch/system/memory.c
PATCH 1/1 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.
--- tests/tcg/multiarch/system/memory.c | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-)
tests/tcg/multiarch/system/memory.c +4 -5
@@ -14,7 +14,6 @@#include <stdint.h> #include <stdbool.h> -#include <inttypes.h> #include <minilib.h> #ifndef CHECK_UNALIGNED
@@ -511,8 +510,8 @@ int main(void)int i;bool ok = true; -ml_printf ("Test data start: 0x%" PRIxPTR"\n" , &test_data[0 ]); -ml_printf ("Test data end: 0x%" PRIxPTR"\n" , &test_data[TEST_SIZE ]); +ml_printf ("Test data start: 0x%lx\n" , (unsigned long )&test_data[0 ]); +ml_printf ("Test data end: 0x%lx\n" , (unsigned long )&test_data[TEST_SIZE ]);/* Run through the unsigned tests first */ for (i =0 ; i <ARRAY_SIZE (init_ufns) && ok; i++) {
@@ -529,8 +528,8 @@ int main(void) ok =do_signed_reads (true); } -ml_printf ("Test data read: %" PRId32"\n" , test_read_count); -ml_printf ("Test data write: %" PRId32"\n" , test_write_count); +ml_printf ("Test data read: %lu\n" , (unsigned long )test_read_count); +ml_printf ("Test data write: %lu\n" , (unsigned long )test_write_count);ml_printf ("Test complete: %s\n" , ok ?"PASSED" :"FAILED" );return ok ?0 :-1 ; }
Signature · 1 line
2.46.2
Quoted 12 lines · Ilya Leoshkevich
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.
Quoted 6 lines
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 <[email protected]>
Quoted 38 lines
--- tests/tcg/multiarch/system/memory.c | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-)tests/tcg/multiarch/system/memory.c +4
-5@@ -14,7 +14,6 @@#include <stdint.h> #include <stdbool.h> -#include <inttypes.h> #include <minilib.h> #ifndef CHECK_UNALIGNED @@ -511,8 +510,8 @@ int main(void)int i;bool ok = true; -ml_printf ("Test data start: 0x%" PRIxPTR"\n" , &test_data[0 ]); -ml_printf ("Test data end: 0x%" PRIxPTR"\n" , &test_data[TEST_SIZE ]); +ml_printf ("Test data start: 0x%lx\n" , (unsigned long )&test_data[0 ]); +ml_printf ("Test data end: 0x%lx\n" , (unsigned long )&test_data[TEST_SIZE ]);/* Run through the unsigned tests first */ for (i =0 ; i <ARRAY_SIZE (init_ufns) && ok; i++) {@@ -529,8 +528,8 @@ int main(void) ok =do_signed_reads (true); } -ml_printf ("Test data read: %" PRId32"\n" , test_read_count); -ml_printf ("Test data write: %" PRId32"\n" , test_write_count); +ml_printf ("Test data read: %lu\n" , (unsigned long )test_read_count); +ml_printf ("Test data write: %lu\n" , (unsigned long )test_write_count);ml_printf ("Test complete: %s\n" , ok ?"PASSED" :"FAILED" );return ok ?0 :-1 ; }
Quoted 19 lines · Paolo Bonzini
Quoted 18 lines · Ilya Leoshkevich
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.
Quoted 5 lines
Quoted 3 lines
Fixes ecbcc9ead2f8 ("tests/tcg: add a system test to check memoryinstrumentation")
Signed-off-by Ilya Leoshkevich <[email protected]>Reviewed-by Paolo Bonzini <[email protected]>
[...]
Thanks for the review!
Could someone please pick this one and also [1] up?
Both patches are aimed at improving the situation with the test builds.
Richard Henderson
AppliedQuoted 28 lines · Ilya Leoshkevich
Quoted 24 lines · Paolo Bonzini
Quoted 14 lines · Ilya Leoshkevich
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.
Quoted 7 lines
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 memoryinstrumentation")
Signed-off-by Ilya Leoshkevich <[email protected]>Reviewed-by Paolo Bonzini <[email protected]>[...]
Quoted 7 lines
Thanks for the review!
Could someone please pick this one and also [1] up?
Both patches are aimed at improving the situation with the test builds.
Queued, thanks.
r~
Quoted 40 lines · Richard Henderson
Quoted 39 lines · Ilya Leoshkevich
Quoted 23 lines · Paolo Bonzini
Quoted 22 lines · Ilya Leoshkevich
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.Quoted 6 lines
Quoted 4 lines
Fixes ecbcc9ead2f8 ("tests/tcg: add a system test to checkmemory
instrumentation")Signed-off-by Ilya Leoshkevich <[email protected]>Reviewed-by Paolo Bonzini <[email protected]>[...]
Thanks for the review!
Could someone please pick this one and also [1] up? Both patches are aimed at improving the situation with the test builds.
Quoted 6 lines
Quoted 2 lines
Queued, thanks.
r~
Hi Richard,
I noticed that this patch doesn't seem to be in master yet. Could it be that it was overlooked, or is there some issue with it that I missed?
Best regards,
Ilya
Quoted 44 lines · Ilya Leoshkevich
Quoted 43 lines · Richard Henderson
Quoted 41 lines · Ilya Leoshkevich
Quoted 23 lines · Paolo Bonzini
Quoted 22 lines · Ilya Leoshkevich
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.Quoted 6 lines
Quoted 4 lines
Fixes ecbcc9ead2f8 ("tests/tcg: add a system test to checkmemory
instrumentation")Signed-off-by Ilya Leoshkevich <[email protected]>Reviewed-by Paolo Bonzini <[email protected]>[...]
Thanks for the review!
Could someone please pick this one and also [1] up? Both patches are aimed at improving the situation with the test builds.
Quoted 8 lines
Quoted 3 lines
Queued, thanks.
r~
Hi Richard,
I noticed that this patch doesn't seem to be in master yet. Could it be that it was overlooked, or is there some issue with it that I missed?
Sorry, I'm not sure what happened. I must have made some mistake with destructive branch pushing somewhere. I've queued it again. :-}
r~