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

Ian Romanick idr at freedesktop.org
Wed Aug 26 10:19:55 PDT 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 1927 to 1664
(reduction of 263).

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 a9b59b2..a49e376 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.1.0



More information about the mesa-dev mailing list