@samitouri / QOSamiQemu / commits / 4efd93949f

meson: Add -Wformat-overflow=2

https://gcc.gnu.org/onlinedocs/gcc-15.2.0/gcc/Warning-Options.html > Level 2 warns also about calls that might overflow the destination > buffer given an argument of sufficient length or magnitude. At level > 2, unknown numeric arguments are assumed to have the minimum > representable value for signed types with a precision greater than 1, > and the maximum representable value otherwise. Unknown string > arguments whose length cannot be assumed to be bounded either by the > directive’s precision, or by a finite set of string literals they may > evaluate to, or the character array they may point to, are assumed to > be 1 character long. Signed-off-by: Akihiko Odaki <odaki@rsg.ci.i.u-tokyo.ac.jp> Reviewed-by: Peter Maydell <peter.maydell@linaro.org> Message-ID: <20260305-nvme-v4-4-b65b9de1839f@rsg.ci.i.u-tokyo.ac.jp> Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>

Akihiko Odaki committed Mar 5, 2026 at 15:16 UTC 4efd93949f5a44238fb7446af41ae239930ce3a5
1 file changed +1
meson.build
+1
@@ -694,6 +694,7 @@ warn_flags = [
694 '-Wempty-body',
695 '-Wendif-labels',
696 '-Wexpansion-to-defined',
697 + '-Wformat-overflow=2',
698 '-Wformat-security',
699 '-Wformat-y2k',
700 '-Wignored-qualifiers',