diff options
author | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2010-10-26 09:09:39 +0000 |
---|---|---|
committer | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2010-10-26 09:09:39 +0000 |
commit | 67d7448fca92474e2701e4ca973c03dbb06b4690 (patch) | |
tree | 2b50984e808292aa702e248198d4b94c267d1f27 | |
parent | 51d25ca8c0eb7da192f5bdf2729fc856e8f81a9d (diff) | |
download | ruby-67d7448fca92474e2701e4ca973c03dbb06b4690.tar.gz |
* vsnprintf.c (BSD_vfprintf): suppress warnings.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@29597 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
-rw-r--r-- | vsnprintf.c | 10 |
1 files 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 <errno.h> #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 */ |