avoid a warning from gcc
authorJim Meyering <meyering@redhat.com>
Wed, 21 May 2008 16:38:12 +0000 (18:38 +0200)
committerJim Meyering <meyering@redhat.com>
Wed, 21 May 2008 16:40:57 +0000 (18:40 +0200)
* lib/vasnprintf.c (IF_LINT): Define.
(scale10_round_decimal_long_double):
Use it to avoid a "may be used uninitialized" warning.

ChangeLog
lib/vasnprintf.c

index 95c58ec..c1bd3f2 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2008-05-21  Jim Meyering  <meyering@redhat.com>
+
+       avoid a warning from gcc
+       * lib/vasnprintf.c (IF_LINT): Define.
+       (scale10_round_decimal_long_double):
+       Use it to avoid a "may be used uninitialized" warning.
+
 2008-05-21  Simon Josefsson  <simon@josefsson.org>
 
        * m4/memcmp.m4: When cross-compiling, assume memcmp works if it is
index 66ce420..9018c60 100644 (file)
 # include "fpucw.h"
 #endif
 
+/* Use this to suppress gcc's `...may be used before initialized' warnings. */
+#ifdef lint
+# define IF_LINT(Code) Code
+#else
+# define IF_LINT(Code) /* empty */
+#endif
+
 #if HAVE_WCHAR_T
 # if HAVE_WCSLEN
 #  define local_wcslen wcslen
@@ -1205,7 +1212,7 @@ scale10_round_decimal_decoded (int e, mpn_t m, void *memory, int n)
 static char *
 scale10_round_decimal_long_double (long double x, int n)
 {
-  int e;
+  int e IF_LINT(= 0);
   mpn_t m;
   void *memory = decode_long_double (x, &e, &m);
   return scale10_round_decimal_decoded (e, m, memory, n);