Peter Maydell <[email protected]> writes:

> On Tue, 10 Mar 2026 at 13:47, Fabiano Rosas <[email protected]> wrote:
>> ../tests/qtest/ast2700-sgpio-test.c: In function ‘test_output_pins’:
>> ../tests/qtest/ast2700-sgpio-test.c:27:33: error: ‘sprintf’ may write a
>> terminating nul past the end of the destination
>> [-Werror=format-overflow=]
>>
>> ../tests/qtest/ast2700-sgpio-test.c: In function ‘test_irq_level_high’:
>> ../tests/qtest/ast2700-sgpio-test.c:85:33: error: ‘sprintf’ may write a
>> terminating nul past the end of the destination
>> [-Werror=format-overflow=]
>>
>> ../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=]
>>
>> ../configure
>> --target-list=x86_64-softmmu,i386-softmmu,aarch64-softmmu,arm-softmmu,ppc64-softmmu,s390x-softmmu,riscv64-softmmu,aarch64-linux-user,loongarch64-softmmu
>> --disable-plugins --enable-modules --enable-werror
>> --enable-trace-backends=log,dtrace --enable-debug --enable-docs
>> --enable-rust --enable-strict-rust-lints
>
> Could you do a configure with all targets enabled and a make with
> "-k" so we can check that these are all the source files your gcc
> complains about, please?
>

Yep, it's just these ones:

tests/qtest/ast2700-gpio-test.p/ast2700-gpio-test.c.o
tests/qtest/ast2700-sgpio-test.p/ast2700-sgpio-test.c.o
tests/qtest/arm-cpu-features.p/arm-cpu-features.c.o
tests/qtest/aspeed_gpio-test.p/aspeed_gpio-test.c.o


[5862/6179] Compiling C object 
tests/qtest/ast2700-gpio-test.p/ast2700-gpio-test.c.o
FAILED: tests/qtest/ast2700-gpio-test.p/ast2700-gpio-test.c.o
../tests/qtest/ast2700-gpio-test.c: In function ‘test_input_pins’:
../tests/qtest/ast2700-gpio-test.c:54:36: error: ‘sprintf’ may write a 
terminating nul past the end of the destination [-Werror=format-overflow=]
             sprintf(name, "gpio%c%d", c, i);
                                    ^
../tests/qtest/ast2700-gpio-test.c:54:13: note: ‘sprintf’ output between 7 and 
17 bytes into a destination of size 16
             sprintf(name, "gpio%c%d", c, i);
             ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~


[5875/6179] Compiling C object 
tests/qtest/ast2700-sgpio-test.p/ast2700-sgpio-test.c.o
FAILED: tests/qtest/ast2700-sgpio-test.p/ast2700-sgpio-test.c.o
../tests/qtest/ast2700-sgpio-test.c: In function ‘test_output_pins’:
../tests/qtest/ast2700-sgpio-test.c:27:33: error: ‘sprintf’ may write a 
terminating nul past the end of the destination [-Werror=format-overflow=]
         sprintf(name, "sgpio%03d", i * 2 + 1);
                                 ^
../tests/qtest/ast2700-sgpio-test.c:27:9: note: ‘sprintf’ output between 9 and 
17 bytes into a destination of size 16
         sprintf(name, "sgpio%03d", i * 2 + 1);
         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
../tests/qtest/ast2700-sgpio-test.c: In function ‘test_input_pins’:
../tests/qtest/ast2700-sgpio-test.c:54:33: error: ‘sprintf’ may write a 
terminating nul past the end of the destination [-Werror=format-overflow=]
         sprintf(name, "sgpio%03d", i * 2);
                                 ^
../tests/qtest/ast2700-sgpio-test.c:54:9: note: ‘sprintf’ output between 9 and 
17 bytes into a destination of size 16
         sprintf(name, "sgpio%03d", i * 2);
         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
../tests/qtest/ast2700-sgpio-test.c: In function ‘test_irq_level_high’:
../tests/qtest/ast2700-sgpio-test.c:85:33: error: ‘sprintf’ may write a 
terminating nul past the end of the destination [-Werror=format-overflow=]
         sprintf(name, "sgpio%03d", i * 2);
                                 ^
../tests/qtest/ast2700-sgpio-test.c:85:9: note: ‘sprintf’ output between 9 and 
17 bytes into a destination of size 16
         sprintf(name, "sgpio%03d", i * 2);
         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~


[5896/6179] Compiling C object 
tests/qtest/arm-cpu-features.p/arm-cpu-features.c.o
FAILED: tests/qtest/arm-cpu-features.p/arm-cpu-features.c.o
../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=]
             sprintf(max_name, "sve%u", max_vq * 128);
                                   ^~
../tests/qtest/arm-cpu-features.c:578:13: note: ‘sprintf’ output between 5 and 
14 bytes into a destination of size 8
             sprintf(max_name, "sve%u", max_vq * 128);
             ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
../tests/qtest/arm-cpu-features.c:598:35: error: ‘%u’ directive writing between 
1 and 10 bytes into a region of size 5 [-Werror=format-overflow=]
                 sprintf(name, "sve%u", vq * 128);
                                   ^~
../tests/qtest/arm-cpu-features.c:598:17: note: ‘sprintf’ output between 5 and 
14 bytes into a destination of size 8
                 sprintf(name, "sve%u", vq * 128);
                 ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
../tests/qtest/arm-cpu-features.c:611:31: error: ‘%u’ directive writing between 
1 and 10 bytes into a region of size 5 [-Werror=format-overflow=]
             sprintf(name, "sve%u", vq * 128);
                               ^~
../tests/qtest/arm-cpu-features.c:611:13: note: ‘sprintf’ output between 5 and 
14 bytes into a destination of size 8
             sprintf(name, "sve%u", vq * 128);
             ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
../tests/qtest/arm-cpu-features.c:623:35: error: ‘%u’ directive writing between 
1 and 10 bytes into a region of size 5 [-Werror=format-overflow=]
                 sprintf(name, "sve%u", vq * 128);
                                   ^~
../tests/qtest/arm-cpu-features.c:623:17: note: ‘sprintf’ output between 5 and 
14 bytes into a destination of size 8
                 sprintf(name, "sve%u", vq * 128);
                 ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~


[5974/6179] Compiling C object 
tests/qtest/aspeed_gpio-test.p/aspeed_gpio-test.c.o
FAILED: tests/qtest/aspeed_gpio-test.p/aspeed_gpio-test.c.o
../tests/qtest/aspeed_gpio-test.c: In function ‘test_set_input_pins’:
../tests/qtest/aspeed_gpio-test.c:149:36: error: ‘sprintf’ may write a 
terminating nul past the end of the destination [-Werror=format-overflow=]
             sprintf(name, "gpio%c%d", c, i);
                                    ^
../tests/qtest/aspeed_gpio-test.c:149:13: note: ‘sprintf’ output between 7 and 
17 bytes into a destination of size 16
             sprintf(name, "gpio%c%d", c, i);
             ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Reply via email to