From: Fabiano Rosas <farosas@suse.de>
To: Peter Maydell <peter.maydell@linaro.org>
Cc: "Philippe Mathieu-Daudé" <philmd@linaro.org>, qemu-devel@nongnu.org
Subject: Re: [PULL 27/49] meson: Add -Wformat-overflow=2
Date: Tue, 10 Mar 2026 12:23:51 -0300 [thread overview]
Message-ID: <87bjgv1zeg.fsf@suse.de> (raw)
In-Reply-To: <CAFEAcA8DpJno_LRrxyjMxDx5gqH_m_PNeqtZxnkg9mZ_QwbzFg@mail.gmail.com>
Peter Maydell <peter.maydell@linaro.org> writes:
> On Tue, 10 Mar 2026 at 13:47, Fabiano Rosas <farosas@suse.de> 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);
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
next prev parent reply other threads:[~2026-03-10 15:24 UTC|newest]
Thread overview: 64+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-03-09 15:51 [PULL 00/49] Misc HW patches for 2026-03-09 Philippe Mathieu-Daudé
2026-03-09 15:51 ` [PULL 01/49] hw/timer/hpet: Remove HPETState::hpet_offset_saved field Philippe Mathieu-Daudé
2026-03-09 15:51 ` [PULL 02/49] hw/i386/pc: Remove deprecated pc-q35/pc-i440fx/xenfv 3.1 machines Philippe Mathieu-Daudé
2026-03-09 15:51 ` [PULL 03/49] hw/i386/pc: Remove PCMachineClass::pvh_enabled field Philippe Mathieu-Daudé
2026-03-09 15:51 ` [PULL 04/49] hw/i386/x86: Remove @pvh_enabled argument in x86_load_linux() Philippe Mathieu-Daudé
2026-03-09 15:51 ` [PULL 05/49] hw/core/boards: Remove MachineClass::smbus_no_migration_support field Philippe Mathieu-Daudé
2026-03-09 15:51 ` [PULL 06/49] hw/i386/pc: Remove pc_compat_3_1[] array Philippe Mathieu-Daudé
2026-03-09 15:51 ` [PULL 07/49] hw/i386/iommu: Remove IntelIOMMUState::dma_drain field Philippe Mathieu-Daudé
2026-03-09 15:51 ` [PULL 08/49] target/i386/cpu: Remove X86CPU::intel_pt_auto_level field Philippe Mathieu-Daudé
2026-03-09 15:51 ` [PULL 09/49] hw/core/machine: Remove the hw_compat_3_1[] array Philippe Mathieu-Daudé
2026-03-09 15:51 ` [PULL 10/49] hw/pci-bridge/pcie_rp: Remove PCIESlot::disable_acs field Philippe Mathieu-Daudé
2026-03-09 15:51 ` [PULL 11/49] hw/i386/pc: Remove deprecated pc-q35-4.0[.1] and pc-i440fx-4.0 machines Philippe Mathieu-Daudé
2026-03-09 15:51 ` [PULL 12/49] hw/i386/pc: Remove pc_compat_4_0[] array Philippe Mathieu-Daudé
2026-03-09 15:51 ` [PULL 13/49] hw/core/machine: Remove the hw_compat_4_0[] array Philippe Mathieu-Daudé
2026-03-09 15:51 ` [PULL 14/49] hw/virtio: Remove VirtIOBalloon::qemu_4_0_config_size field Philippe Mathieu-Daudé
2026-03-09 15:51 ` [PULL 15/49] hw/rtc/pl031: : Remove PL031State::migrate_tick_offset field Philippe Mathieu-Daudé
2026-03-09 15:51 ` [PULL 16/49] tests: fix leaks in dbus-display-test Philippe Mathieu-Daudé
2026-03-09 15:51 ` [PULL 17/49] ui/dbus: fix leak regression Philippe Mathieu-Daudé
2026-03-09 15:51 ` [PULL 18/49] ui/dbus: fix Unix.Map proxy leak Philippe Mathieu-Daudé
2026-03-09 15:51 ` [PULL 19/49] ui/dbus: fix pixman cleanup Philippe Mathieu-Daudé
2026-03-09 15:51 ` [PULL 20/49] coreaudio: Remove unnecessary explicit casts Philippe Mathieu-Daudé
2026-03-09 15:51 ` [PULL 21/49] coreaudio: Remove extra whitespaces Philippe Mathieu-Daudé
2026-03-09 15:51 ` [PULL 22/49] virtio-snd: remove a redundant memory allocation Philippe Mathieu-Daudé
2026-03-09 15:51 ` [PULL 23/49] virtio-snd: remove redundant fields Philippe Mathieu-Daudé
2026-03-09 15:51 ` [PULL 24/49] contrib/elf2dmp: Grow PDB URL buffer Philippe Mathieu-Daudé
2026-03-09 15:51 ` [PULL 25/49] vfio/pci: Grow buffer in vfio_pci_host_match() Philippe Mathieu-Daudé
2026-03-09 15:51 ` [PULL 26/49] tests: Clean up double comparisons to avoid compiler warning Philippe Mathieu-Daudé
2026-03-09 15:51 ` [PULL 27/49] meson: Add -Wformat-overflow=2 Philippe Mathieu-Daudé
2026-03-10 13:47 ` Fabiano Rosas
2026-03-10 14:37 ` Philippe Mathieu-Daudé
2026-03-10 15:20 ` Peter Maydell
2026-03-10 14:51 ` Peter Maydell
2026-03-10 15:17 ` Minimal GCC version for QEMU (was: Re: [PULL 27/49] meson: Add -Wformat-overflow=2) Thomas Huth
2026-03-10 15:30 ` Daniel P. Berrangé
2026-03-10 15:47 ` Minimal GCC version for QEMU Thomas Huth
2026-03-10 23:06 ` nia
2026-03-11 7:28 ` Thomas Huth
2026-03-11 9:31 ` Daniel P. Berrangé
2026-03-11 9:37 ` Daniel P. Berrangé
2026-03-10 14:53 ` [PULL 27/49] meson: Add -Wformat-overflow=2 Peter Maydell
2026-03-10 15:23 ` Fabiano Rosas [this message]
2026-03-09 15:51 ` [PULL 28/49] net/passt: Only kill passt if it wrote a pidfile Philippe Mathieu-Daudé
2026-03-09 15:51 ` [PULL 29/49] net/passt: Don't try to read the pidfile if passt got a signal Philippe Mathieu-Daudé
2026-03-09 15:52 ` [PULL 30/49] hw/net/npcm_gmac: Catch accesses off the end of the register array Philippe Mathieu-Daudé
2026-03-09 15:52 ` [PULL 31/49] hw/sparc/sun4m: Don't set up dummy cpu interrupts Philippe Mathieu-Daudé
2026-03-09 15:52 ` [PULL 32/49] hw/sparc/sun4m: Use qdev GPIOs rather than qemu_allocate_irqs() Philippe Mathieu-Daudé
2026-03-09 15:52 ` [PULL 33/49] hw/timer/slavio_timer: Free resources allocated in instance_init Philippe Mathieu-Daudé
2026-03-09 15:52 ` [PULL 34/49] hw/qdev: Document qdev_get_dev_path() Philippe Mathieu-Daudé
2026-03-09 15:52 ` [PULL 35/49] hw: Make qdev_get_printable_name() consistently return freeable string Philippe Mathieu-Daudé
2026-03-09 15:52 ` [PULL 36/49] ati-vga: Remove src and dst stride mutation in ati_2d_blt Philippe Mathieu-Daudé
2026-03-09 15:52 ` [PULL 37/49] ati-vga: Use local variables for register values " Philippe Mathieu-Daudé
2026-03-09 15:52 ` [PULL 38/49] ati-vga: Introduce ATI2DCtx struct for 2D blit context Philippe Mathieu-Daudé
2026-03-09 15:52 ` [PULL 39/49] ati-vga: Extract setup_2d_blt_ctx from ati_2d_blt Philippe Mathieu-Daudé
2026-03-09 15:52 ` [PULL 40/49] ati-vga: Split ati_2d_do_blt " Philippe Mathieu-Daudé
2026-03-09 15:52 ` [PULL 41/49] ati-vga: Remove ATIVGAState param from ati_2d_do_blt Philippe Mathieu-Daudé
2026-03-09 15:52 ` [PULL 42/49] ati-vga: Implement scissor rectangle clipping for 2D operations Philippe Mathieu-Daudé
2026-03-09 15:52 ` [PULL 43/49] ati-vga: Implement HOST_DATA register writes Philippe Mathieu-Daudé
2026-03-09 15:52 ` [PULL 44/49] ati-vga: Implement HOST_DATA flush to VRAM Philippe Mathieu-Daudé
2026-03-09 15:52 ` [PULL 45/49] ati-vga: Simplify hw cursor drawing Philippe Mathieu-Daudé
2026-03-09 15:52 ` [PULL 46/49] ati-vga: Do not access pixel outside the screen Philippe Mathieu-Daudé
2026-03-09 15:52 ` [PULL 47/49] hw/i3c/dw-i3c: Fix memory leaks in error logging paths Philippe Mathieu-Daudé
2026-03-09 15:52 ` [PULL 48/49] hw/misc/sifive_e_aon: Don't leak timer Philippe Mathieu-Daudé
2026-03-09 15:52 ` [PULL 49/49] hw/misc/riscv_cpc: Free CPU array in instance_finalize Philippe Mathieu-Daudé
2026-03-10 9:31 ` [PULL 00/49] Misc HW patches for 2026-03-09 Peter Maydell
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=87bjgv1zeg.fsf@suse.de \
--to=farosas@suse.de \
--cc=peter.maydell@linaro.org \
--cc=philmd@linaro.org \
--cc=qemu-devel@nongnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox