build: Add -Woverride-init
authorBenjamin Otte <otte@redhat.com>
Fri, 18 Aug 2023 19:06:59 +0000 (21:06 +0200)
committerMatthias Clasen <mclasen@redhat.com>
Thu, 24 Aug 2023 14:25:59 +0000 (10:25 -0400)
That's a gcc warning (clang has the equivalent -Winitializer-overrides,
but that one is included in -Wall) that complains about things like:

  VkOffset3D offset = { .x = pt.x, .x = pt.y, .y = 0 };

So you don't have to spend a few hours trying to understand what's going
on before realizing your copy/paste skills are substandard.

meson.build

index 5eef06e34292c01522807ebfcc5f4875017cf060..7af8d0383c53c36823838238fc8f671c9266b826 100644 (file)
@@ -309,6 +309,7 @@ elif cc.get_id() == 'gcc' or cc.get_id() == 'clang'
     'missing-declarations',
     'missing-prototypes',
     'nonnull',
+    'override-init',
     'pointer-to-int-cast',
     'redundant-decls',
     'return-type',