Avoid one more warning from gcc.
authorBruno Haible <bruno@clisp.org>
Wed, 21 May 2008 22:53:42 +0000 (00:53 +0200)
committerBruno Haible <bruno@clisp.org>
Wed, 21 May 2008 22:53:42 +0000 (00:53 +0200)
ChangeLog
lib/vasnprintf.c

index f96815a..e515bb0 100644 (file)
--- 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
index ec35109..9c6340c 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
@@ -207,6 +200,14 @@ local_wcslen (const wchar_t *s)
 /* 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 @@ VASNPRINTF (DCHAR_T *resultbuf, size_t *lengthp,
 #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];