From 67d7448fca92474e2701e4ca973c03dbb06b4690 Mon Sep 17 00:00:00 2001 From: nobu Date: Tue, 26 Oct 2010 09:09:39 +0000 Subject: [PATCH] * vsnprintf.c (BSD_vfprintf): suppress warnings. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@29597 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- vsnprintf.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/vsnprintf.c b/vsnprintf.c index ebcb882f89..1ff061ed9c 100644 --- a/vsnprintf.c +++ b/vsnprintf.c @@ -127,6 +127,12 @@ # include #endif +#if __GNUC__ >= 3 +#define UNINITIALIZED_VAR(x) x = x +#else +#define UNINITIALIZED_VAR(x) x +#endif + /* * NB: to fit things in six character monocase externals, the stdio * code uses the prefix `__s' for stdio objects, typically followed @@ -543,9 +549,9 @@ BSD_vfprintf(FILE *fp, const char *fmt0, va_list ap) int ndig = 0; /* actual number of digits returned by cvt */ char expstr[7]; /* buffer for exponent string */ #endif - u_long ulval; /* integer arguments %[diouxX] */ + u_long UNINITIALIZED_VAR(ulval); /* integer arguments %[diouxX] */ #ifdef _HAVE_SANE_QUAD_ - u_quad_t uqval; /* %q integers */ + u_quad_t UNINITIALIZED_VAR(uqval); /* %q integers */ #endif /* _HAVE_SANE_QUAD_ */ int base; /* base for [diouxX] conversion */ int dprec; /* a copy of prec if [diouxX], 0 otherwise */