aboutsummaryrefslogtreecommitdiffstats
path: root/vsnprintf.c
diff options
context:
space:
mode:
authorshyouhei <shyouhei@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2016-09-16 06:15:55 +0000
committershyouhei <shyouhei@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2016-09-16 06:15:55 +0000
commit94a840083584aaafbfc2ca2eadebd0bbf8a92fe9 (patch)
treef95643295c10e0d9a6d8bec6e8c147cdbd83be4a /vsnprintf.c
parent2811cef1b7f0a93efb92024c6f9f70d5ffd7f74e (diff)
downloadruby-94a840083584aaafbfc2ca2eadebd0bbf8a92fe9.tar.gz
* internal.h (WARN_UNUSED_RESULT): moved to configure.in, to
actually check its availability rather to check GCC's version. * configure.in (WARN_UNUSED_RESULT): moved to here. * configure.in (RUBY_FUNC_ATTRIBUTE): change function declaration to return int rather than void, because it makes no sense for a warn_unused_result attributed function to return void. Funny thing however is that it also makes no sense for noreturn attributed function to return int. So there is a fundamental conflict between them. While I tested this, I confirmed both GCC 6 and Clang 3.8 prefers int over void to correctly detect necessary attributes under this setup. Maybe subject to change in future. * internal.h (UNINITIALIZED_VAR): renamed to MAYBE_UNUSED, then moved to configure.in for the same reason we move WARN_UNUSED_RESULT. * configure.in (MAYBE_UNUSED): moved to here. * internal.h (__has_attribute): deleted, because it has no use now. * string.c (rb_str_enumerate_lines): refactor macro rename. * string.c (rb_str_enumerate_bytes): ditto. * string.c (rb_str_enumerate_chars): ditto. * string.c (rb_str_enumerate_codepoints): ditto. * thread.c (do_select): ditto. * vm_backtrace.c (rb_debug_inspector_open): ditto. * vsnprintf.c (BSD_vfprintf): ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@56169 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'vsnprintf.c')
-rw-r--r--vsnprintf.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/vsnprintf.c b/vsnprintf.c
index 65012ea746..9a4f37abe0 100644
--- a/vsnprintf.c
+++ b/vsnprintf.c
@@ -558,9 +558,9 @@ BSD_vfprintf(FILE *fp, const char *fmt0, va_list ap)
int fprec = 0; /* floating point precision */
char expstr[7]; /* buffer for exponent string */
#endif
- u_long UNINITIALIZED_VAR(ulval); /* integer arguments %[diouxX] */
+ u_long MAYBE_UNUSED(ulval); /* integer arguments %[diouxX] */
#ifdef _HAVE_SANE_QUAD_
- u_quad_t UNINITIALIZED_VAR(uqval); /* %q integers */
+ u_quad_t MAYBE_UNUSED(uqval); /* %q integers */
#endif /* _HAVE_SANE_QUAD_ */
int base; /* base for [diouxX] conversion */
int dprec; /* a copy of prec if [diouxX], 0 otherwise */