[Mesa-dev] [PATCH 2/8] nir: Silence missing field initializer warnings for nir_dest

Ian Romanick idr at freedesktop.org
Mon Dec 14 15:34:26 PST 2015


From: Ian Romanick <ian.d.romanick at intel.com>

nir/nir.h:576:4: warning: missing initializer for field 'is_ssa' of 'nir_dest' [
-Wmissing-field-initializers]
    nir_dest dest = NIR_DEST_INIT;
    ^
nir/nir.h:538:10: note: 'is_ssa' declared here
    bool is_ssa;
          ^
nir/nir.h:576:55: warning: missing initializer for member 'nir_reg_dest::def_lin
k' [-Wmissing-field-initializers]
    nir_dest dest = NIR_DEST_INIT;

Number of total warnings in my build reduced from 1932 to 1676
(reduction of 256).

Signed-off-by: Ian Romanick <ian.d.romanick at intel.com>
---
 src/glsl/nir/nir.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/glsl/nir/nir.h b/src/glsl/nir/nir.h
index 5543c52..94f4c74 100644
--- a/src/glsl/nir/nir.h
+++ b/src/glsl/nir/nir.h
@@ -538,7 +538,7 @@ typedef struct {
    bool is_ssa;
 } nir_dest;
 
-#define NIR_DEST_INIT (nir_dest) { { { NULL } } }
+#define NIR_DEST_INIT (nir_dest) { { { NULL, { NULL, NULL }, NULL, NULL, 0 } }, false }
 
 #define nir_foreach_def(reg, dest) \
    list_for_each_entry(nir_dest, dest, &(reg)->defs, reg.def_link)
-- 
2.5.0



More information about the mesa-dev mailing list