GCC's "maybe uninitilized" warnings depend on optimizations for code flow analysis, and produce false positive errors with -Og. Default build gives us coverage with that, so let's just disable with -Og.
Signed-off-by: Michael S. Tsirkin <[email protected]> --- meson.build | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/meson.build b/meson.build index 164328ded8..a119dae6ac 100644 --- a/meson.build +++ b/meson.build @@ -742,6 +742,10 @@ warn_flags = [ '-Wno-typedef-redefinition', ] +if get_option('optimization') == 'g' + warn_flags += ['-Wno-error=maybe-uninitialized'] +endif + if host_os != 'darwin' tsa_has_cleanup = cc.compiles(''' struct __attribute__((capability("mutex"))) mutex {}; -- MST
