From e31cfddf0e08ca605e7693fb6d5a11e02423ef0c Mon Sep 17 00:00:00 2001 From: Bruno Haible Date: Thu, 22 May 2008 00:53:42 +0200 Subject: [PATCH] Avoid one more warning from gcc. --- ChangeLog | 6 ++++++ lib/vasnprintf.c | 17 +++++++++-------- 2 files changed, 15 insertions(+), 8 deletions(-) diff --git a/ChangeLog b/ChangeLog index f96815a33..e515bb039 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2008-05-21 Bruno Haible + + 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 avoid a warning from gcc diff --git a/lib/vasnprintf.c b/lib/vasnprintf.c index ec35109fb..9c6340c48 100644 --- 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 @@ 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]; -- 2.11.0