# HG changeset patch # User Bruno Haible # Date 1211410422 -7200 # Node ID 8d61236d099c78243361ab1f9eab74153d6c9275 # Parent daad35fae43c46e6dd3374c7e0bf44ecd0bdda93 Avoid one more warning from gcc. diff --git a/ChangeLog b/ChangeLog --- 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 --- 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];