On 10/3/26 16:15, Peter Maydell wrote:
Older versions of gcc with -Wformat-overflow=2 don't like the usage of
fixed size char arrays in this test; gcc 7.5.0 (SUSE Linux) says:
../tests/qtest/arm-cpu-features.c: In function
‘test_query_cpu_model_expansion_kvm’:
../tests/qtest/arm-cpu-features.c:578:35: error: ‘%u’ directive writing
between 1 and 10 bytes into a region of size 5
[-Werror=format-overflow=]
These can't actually happen because of the limited size of the values
being substituted in. However rather than require readers to check
whether the arrays really have been declared large enough, we prefer
to use g_strdup_printf() for this kind of string work.
Reported-by: Fabiano Rosas <[email protected]>
Signed-off-by: Peter Maydell <[email protected]>
---
tests/qtest/arm-cpu-features.c | 24 +++++++++++++++---------
1 file changed, 15 insertions(+), 9 deletions(-)
Reviewed-by: Philippe Mathieu-Daudé <[email protected]>