Project

General

Profile

Actions

Bug #14780

closed

In function ‘tr_trans’: warning: unused variable ‘old’

Added by duerst (Martin Dürst) almost 6 years ago. Updated almost 6 years ago.

Status:
Closed
Target version:
-
ruby -v:
ruby 2.6.0dev (2018-05-21 trunk 63475) [x86_64-cygwin]
[ruby-core:87217]

Description

I get the following warnings when compiling string.c:

compiling string.c
string.c: In function ‘tr_trans’:
string.c:7038:10: warning: unused variable ‘old’ [-Wunused-variable]
   size_t old = max + termlen;
          ^~~
string.c:7111:10: warning: unused variable ‘old’ [-Wunused-variable]
   size_t old = max + termlen;

The reason seems to be that the newly introduced macro SIZED_REALLOC_N ignores its last parameter in some versions.

Updated by normalperson (Eric Wong) almost 6 years ago

wrote:

  • ruby -v: ruby 2.6.0dev (2018-05-21 trunk 63475) [x86_64-cygwin]

Can you try r63487? It uses the MAYBE_UNUSED macro which I hope
works for your platform. Thanks.

Updated by duerst (Martin Dürst) almost 6 years ago

  • Status changed from Open to Closed

normalperson (Eric Wong) wrote:

Can you try r63487? It uses the MAYBE_UNUSED macro which I hope
works for your platform. Thanks.

Confirmed and closed. Thanks!

Actions

Also available in: Atom PDF

Like0
Like0Like0