ruby-core@ruby-lang.org archive (unofficial mirror)
 help / color / mirror / Atom feed
* [ruby-core:89780] [Ruby trunk Bug#15299] hash.c: warning: ‘bin’ may be used uninitialized in this function
       [not found] <redmine.issue-15299.20181113093909@ruby-lang.org>
@ 2018-11-13  9:39 ` duerst
  2018-12-09  2:32 ` [ruby-core:90382] " nobu
  2018-12-09  3:25 ` [ruby-core:90383] " duerst
  2 siblings, 0 replies; 3+ messages in thread
From: duerst @ 2018-11-13  9:39 UTC (permalink / raw)
  To: ruby-core

Issue #15299 has been reported by duerst (Martin Dürst).

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

* 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/

^ permalink raw reply	[flat|nested] 3+ messages in thread

* [ruby-core:90382] [Ruby trunk Bug#15299] hash.c: warning: ‘bin’ may be used uninitialized in this function
       [not found] <redmine.issue-15299.20181113093909@ruby-lang.org>
  2018-11-13  9:39 ` [ruby-core:89780] [Ruby trunk Bug#15299] hash.c: warning: ‘bin’ may be used uninitialized in this function duerst
@ 2018-12-09  2:32 ` nobu
  2018-12-09  3:25 ` [ruby-core:90383] " duerst
  2 siblings, 0 replies; 3+ messages in thread
From: nobu @ 2018-12-09  2:32 UTC (permalink / raw)
  To: ruby-core

Issue #15299 has been updated by nobu (Nobuyoshi Nakada).


What version of cc?

It is a false warning.

`bin` is initialized if the hash is not empty, and otherwise `existing` is `FALSE`.
And  the line is in a block of `if (existing)`, so unintialized `bin` never reaches there.

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

* 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/

^ permalink raw reply	[flat|nested] 3+ messages in thread

* [ruby-core:90383] [Ruby trunk Bug#15299] hash.c: warning: ‘bin’ may be used uninitialized in this function
       [not found] <redmine.issue-15299.20181113093909@ruby-lang.org>
  2018-11-13  9:39 ` [ruby-core:89780] [Ruby trunk Bug#15299] hash.c: warning: ‘bin’ may be used uninitialized in this function duerst
  2018-12-09  2:32 ` [ruby-core:90382] " nobu
@ 2018-12-09  3:25 ` duerst
  2 siblings, 0 replies; 3+ messages in thread
From: duerst @ 2018-12-09  3:25 UTC (permalink / raw)
  To: ruby-core

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/

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2018-12-09  3:25 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <redmine.issue-15299.20181113093909@ruby-lang.org>
2018-11-13  9:39 ` [ruby-core:89780] [Ruby trunk Bug#15299] hash.c: warning: ‘bin’ may be used uninitialized in this function duerst
2018-12-09  2:32 ` [ruby-core:90382] " nobu
2018-12-09  3:25 ` [ruby-core:90383] " duerst

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).