[ruby-core:90383] [Ruby trunk Bug#15299] hash.c: warning: ‘bin’ may be used uninitialized in this function

From: duerst@...
Date: 2018-12-09 03:25:01 UTC
List: ruby-core #90383
Issue #15299 has been updated by duerst (Martin Dürst).


nobu (Nobuyoshi Nakada) wrote:
> What version of cc?

[duerst@stazersee ruby2]$ gcc --version
gcc (GCC) 4.8.3 20140911 (Red Hat 4.8.3-7)


----------------------------------------
Bug #15299: hash.c: warning: ‘bin’ may be used uninitialized in this function
https://bugs.ruby-lang.org/issues/15299#change-75503

* Author: duerst (Martin Dürst)
* Status: Open
* Priority: Normal
* Assignee: nobu (Nobuyoshi Nakada)
* Target version: 
* ruby -v: ruby 2.4.0dev (2016-06-09 trunk 55334) [x86_64-linux]
* Backport: 2.3: UNKNOWN, 2.4: UNKNOWN, 2.5: UNKNOWN
----------------------------------------
When compiling the latest version of trunk, I get some warnings in hash.c, as follows:

```
compiling hash.c
hash.c: In function ‘linear_update’:
hash.c:849:24: warning: ‘bin’ may be used uninitialized in this function [-Wmaybe-uninitialized]
             clear_entry(RHASH_ARRAY_REF(hash, bin));
                        ^
hash.c: In function ‘rb_hash_stlike_update’:
hash.c:849:24: warning: ‘bin’ may be used uninitialized in this function [-Wmaybe-uninitialized]
hash.c:811:14: note: ‘bin’ was declared here
     unsigned bin;
              ^
```

This warning appeared already when I reported issue #15279, but I didn't mention it because I hoped it would also disappear when #15279 was fixed.



-- 
https://bugs.ruby-lang.org/

Unsubscribe: <mailto:ruby-core-request@ruby-lang.org?subject=unsubscribe>
<http://lists.ruby-lang.org/cgi-bin/mailman/options/ruby-core>

In This Thread

Prev Next