From: Jim Meyering <meyering@redhat.com>
Date: Wed, 21 May 2008 21:09:59 +0000 (+0200)
Subject: avoid another warning from gcc
X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=889c9cb84b2aff4a4f7ff9c35cacf2adbb0644c4;p=pspp

avoid another warning from gcc

* lib/vasnprintf.c (scale10_round_decimal_double):
Use IF_LINT to avoid another "may be used uninitialized" warning.
---

diff --git a/ChangeLog b/ChangeLog
index c1bd3f2bf5..f96815a33c 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -4,6 +4,7 @@
 	* lib/vasnprintf.c (IF_LINT): Define.
 	(scale10_round_decimal_long_double):
 	Use it to avoid a "may be used uninitialized" warning.
+	(scale10_round_decimal_double): Likewise.
 
 2008-05-21  Simon Josefsson  <simon@josefsson.org>
 
diff --git a/lib/vasnprintf.c b/lib/vasnprintf.c
index 9018c60968..ec35109fba 100644
--- a/lib/vasnprintf.c
+++ b/lib/vasnprintf.c
@@ -1230,7 +1230,7 @@ scale10_round_decimal_long_double (long double x, int n)
 static char *
 scale10_round_decimal_double (double x, int n)
 {
-  int e;
+  int e IF_LINT(= 0);
   mpn_t m;
   void *memory = decode_double (x, &e, &m);
   return scale10_round_decimal_decoded (e, m, memory, n);