@matheusbsbs / matheus-bagliano / commits / 0039ba7e5e
Fork 0

unpack-trees.c: work around run-time array initialization flaw on IRIX 6.5

The c99 MIPSpro Compiler version 7.4.4m on IRIX 6.5 does not properly initialize run-time initialized arrays. An array which is initialized with fewer elements than the length of the array should have the unitialized elements initialized to zero. This compiler only initializes the remaining elements when the last element is a static parameter. So work around it by adding a "NULL" initialization parameter. Signed-off-by: Brandon Casey <casey@nrlssc.navy.mil> Signed-off-by: Junio C Hamano <gitster@pobox.com>

Brandon Casey committed Jul 10, 2009 at 12:10 UTC 0039ba7e5e630502be9ac601845b214abce93750
1 file changed +1 -1
unpack-trees.c
+1 -1
@@ -128,7 +128,7 @@ static inline int call_unpack_fn(struct cache_entry **src, struct unpack_trees_o
128
129 static int unpack_index_entry(struct cache_entry *ce, struct unpack_trees_options *o)
130 {
131 - struct cache_entry *src[5] = { ce, };
131 + struct cache_entry *src[5] = { ce, NULL, };
132
133 o->pos++;
134 if (ce_stage(ce)) {