From 2fd1525b0f17b986882140a7a337008befd31983 Mon Sep 17 00:00:00 2001 From: normal Date: Tue, 22 May 2018 01:58:47 +0000 Subject: string.c: MAYBE_UNUSED to suppress warnings for `old` Building with HAVE_MALLOC_USABLE_SIZE currently makes SIZED_REALLOC_N ignore the old size arg. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63487 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- string.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'string.c') diff --git a/string.c b/string.c index 347937e383..3f3432fe4a 100644 --- a/string.c +++ b/string.c @@ -7035,7 +7035,7 @@ tr_trans(VALUE str, VALUE src, VALUE repl, int sflag) if (enc != e1) may_modify = 1; } if ((offset = t - buf) + tlen > max) { - size_t old = max + termlen; + size_t MAYBE_UNUSED(old) = max + termlen; max = offset + tlen + (send - s); SIZED_REALLOC_N(buf, char, max + termlen, old); t = buf + offset; @@ -7108,7 +7108,7 @@ tr_trans(VALUE str, VALUE src, VALUE repl, int sflag) if (enc != e1) may_modify = 1; } if ((offset = t - buf) + tlen > max) { - size_t old = max + termlen; + size_t MAYBE_UNUSED(old) = max + termlen; max = offset + tlen + (long)((send - s) * 1.2); SIZED_REALLOC_N(buf, char, max + termlen, old); t = buf + offset; -- cgit v1.2.3