[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
vasnprintf.c needs IF_LINT, too
From: |
Jim Meyering |
Subject: |
vasnprintf.c needs IF_LINT, too |
Date: |
Wed, 21 May 2008 18:43:35 +0200 |
Oops. I mistakenly pushed the latter unreviewed change (to avoid
this warning) along with the typo-fixing one. Sorry, Bruno.
cc1: warnings being treated as errors
vasnprintf.c: In function 'scale10_round_decimal_long_double':
vasnprintf.c:1208: error: 'e' may be used uninitialized in this function
>From 6dc931a793edc6f071d734f1f52f452bb96d02aa Mon Sep 17 00:00:00 2001
From: Jim Meyering <address@hidden>
Date: Tue, 20 May 2008 15:06:25 +0200
Subject: [PATCH] fix typos in ChangeLog entries
---
ChangeLog | 4 ++--
1 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/ChangeLog b/ChangeLog
index 7b1b86a..95c58ec 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -51,7 +51,7 @@
avoid a warning from gcc
* lib/trim.c (IF_LINT): Define.
- (trim2): Use it to void a "may be used uninitialized" warning.
+ (trim2): Use it to avoid a "may be used uninitialized" warning.
Fix doc typo.
* doc/glibc-functions/getpass.texi (getpass): s/PATH_MAX/PASS_MAX/.
@@ -463,7 +463,7 @@
avoid a warning from gcc
* lib/getndelim2.c (IF_LINT): Define.
- (getndelim2): Use it to void a "may be used uninitialized" warning.
+ (getndelim2): Use it to avoid a "may be used uninitialized" warning.
vc-list-files: work properly with build-aux/cvsu, too
* build-aux/vc-list-files: Hoist the "./"-removing code to apply
--
1.5.5.1.249.g68ef3
>From 9e52f3ef782a31dd78cfc591eaf76721a5203ab8 Mon Sep 17 00:00:00 2001
From: Jim Meyering <address@hidden>
Date: Wed, 21 May 2008 18:38:12 +0200
Subject: [PATCH] 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.
---
ChangeLog | 7 +++++++
lib/vasnprintf.c | 9 ++++++++-
2 files changed, 15 insertions(+), 1 deletions(-)
diff --git a/ChangeLog b/ChangeLog
index 95c58ec..c1bd3f2 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2008-05-21 Jim Meyering <address@hidden>
+
+ 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 <address@hidden>
* m4/memcmp.m4: When cross-compiling, assume memcmp works if it is
diff --git a/lib/vasnprintf.c b/lib/vasnprintf.c
index 66ce420..9018c60 100644
--- a/lib/vasnprintf.c
+++ b/lib/vasnprintf.c
@@ -117,6 +117,13 @@
# 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);
--
1.5.5.1.249.g68ef3
- vasnprintf.c needs IF_LINT, too,
Jim Meyering <=