changeset 10102:8d61236d099c

Avoid one more warning from gcc.
author Bruno Haible <bruno@clisp.org>
date Thu, 22 May 2008 00:53:42 +0200
parents daad35fae43c
children c38a426cd67a
files ChangeLog lib/vasnprintf.c
diffstat 2 files changed, 15 insertions(+), 8 deletions(-) [+]
line wrap: on
line diff
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2008-05-21  Bruno Haible  <bruno@clisp.org>
+
+	Avoid one more warning from gcc.
+	* lib/vasnprintf.c (IF_LINT): Update comments.
+	(VASNPRINTF): Use it also for the 'prefix' array initializer.
+
 2008-05-21  Jim Meyering  <meyering@redhat.com>
 
 	avoid a warning from gcc
--- a/lib/vasnprintf.c
+++ b/lib/vasnprintf.c
@@ -117,13 +117,6 @@
 # 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
@@ -207,6 +200,14 @@
 /* Here we need to call the native sprintf, not rpl_sprintf.  */
 #undef sprintf
 
+/* GCC >= 4.0 with -Wall emits unjustified "... may be used uninitialized"
+   warnings in this file.  Use -Dlint to suppress them.  */
+#ifdef lint
+# define IF_LINT(Code) Code
+#else
+# define IF_LINT(Code) /* empty */
+#endif
+
 /* Avoid some warnings from "gcc -Wshadow".
    This file doesn't use the exp() and remainder() functions.  */
 #undef exp
@@ -3707,7 +3708,7 @@
 #endif
 		TCHAR_T *fbp;
 		unsigned int prefix_count;
-		int prefixes[2];
+		int prefixes[2] IF_LINT (= { 0, 0 });
 #if !USE_SNPRINTF
 		size_t tmp_length;
 		TCHAR_T tmpbuf[700];