Skip to contentSkip to conversation

db: fix uninitialised variable warnings

PATCH In review Dave Chinner 2 participants 2 messages Aug 5, 2015 – Aug 7, 2015

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 db: fix uninitialised variable warnings

From: Dave Chinner <[email protected]>

New versions of gcc barf on the conversion table code in db/convert.c. Shut it up by initialising the conversion array.

---
 db/convert.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
db/convert.c +1 -1
index 09f9225..a337abe 100644
@@ -157,7 +157,7 @@ convert_f(int argc, char **argv)
 {
 	ctype_t		c;
 	int		conmask;
-	cval_t		cvals[NCTS];
+	cval_t		cvals[NCTS] = {};
 	int		i;
 	int		mask;
 	__uint64_t	v;
Signature · 6 lines
2.1.4

_______________________________________________
xfs mailing list
[email protected]
http://oss.sgi.com/mailman/listinfo/xfs
Reviewed-by on v1 1/1
#1 lore raw
Quoted 7 lines · Dave Chinner

From: Dave Chinner <[email protected]>

New versions of gcc barf on the conversion table code in db/convert.c. Shut it up by initialising the conversion array.

---

Quoted 23 lines
 db/convert.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
db/convert.c +1 -1
index 09f9225..a337abe 100644
@@ -157,7 +157,7 @@ convert_f(int argc, char **argv)
 {
 	ctype_t		c;
 	int		conmask;
-	cval_t		cvals[NCTS];
+	cval_t		cvals[NCTS] = {};
 	int		i;
 	int		mask;
 	__uint64_t	v;
Signature · 6 lines
2.1.4

_______________________________________________
xfs mailing list
[email protected]
http://oss.sgi.com/mailman/listinfo/xfs

_______________________________________________
xfs mailing list
[email protected]
http://oss.sgi.com/mailman/listinfo/xfs