Project

General

Profile

Bug #13387

[PATCH]Add parenthesis to fix compile warning to string.c

Added by litmon (Fukuo Kadota) over 2 years ago. Updated about 2 years ago.

Status:
Closed
Priority:
Normal
Assignee:
-
Target version:
-
[ruby-core:80471]

Description

When editing string.c and execute make run, below warnings showed.

$ make run
../ruby/string.c:6142:41: warning: '&&' within '||' [-Wlogical-op-parentheses]
  ...(flags&ONIGENC_CASE_ASCII_ONLY) && (enc==rb_utf8_encoding() || rb_enc_mbmaxlen(enc)==1)
     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
../ruby/string.c:6142:41: note: place parentheses around the '&&' expression to
      silence this warning
  ...(flags&ONIGENC_CASE_ASCII_ONLY) && (enc==rb_utf8_encoding() || rb_enc_mbmaxlen(enc)==1)
                                     ^
     (                                                                                      )
../ruby/string.c:6208:41: warning: '&&' within '||' [-Wlogical-op-parentheses]
  ...(flags&ONIGENC_CASE_ASCII_ONLY) && (enc==rb_utf8_encoding() || rb_enc_mbmaxlen(enc)==1)
     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
../ruby/string.c:6208:41: note: place parentheses around the '&&' expression to
      silence this warning
  ...(flags&ONIGENC_CASE_ASCII_ONLY) && (enc==rb_utf8_encoding() || rb_enc_mbmaxlen(enc)==1)
                                     ^
     (                                                                                      )

I fixed this warnings using note.
in Github:
https://github.com/ruby/ruby/pull/1570

Associated revisions

Revision 31a755e4
Added by sorah (Sorah Fukumori) over 2 years ago

string.c: Supress logical-op-parentheses warning

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@58211 b2dd03c8-39d4-4d8f-98ff-823fe69b080e

Revision 58211
Added by sorah (Sorah Fukumori) over 2 years ago

string.c: Supress logical-op-parentheses warning

Revision 58211
Added by sorah (Sorah Fukumori) over 2 years ago

string.c: Supress logical-op-parentheses warning

Revision 58211
Added by sorah (Sorah Fukumori) over 2 years ago

string.c: Supress logical-op-parentheses warning

Revision 72fcda8b
Added by nagachika (Tomoyuki Chikanaga) about 2 years ago

merge revision(s) 58211: [Backport #13387]

    string.c: Supress logical-op-parentheses warning

    * string.c(rb_str_upcase_bang): Supress logical-op-parentheses warning
      Patch by Fukuo Kadota <fukuo-kadota@cookpad.com>,
      Closes [GH-1570] [Bug #13387].

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_2_4@58635 b2dd03c8-39d4-4d8f-98ff-823fe69b080e

Revision 58635
Added by nagachika (Tomoyuki Chikanaga) about 2 years ago

merge revision(s) 58211: [Backport #13387]

string.c: Supress logical-op-parentheses warning

* string.c(rb_str_upcase_bang): Supress logical-op-parentheses warning
  Patch by Fukuo Kadota <fukuo-kadota@cookpad.com>,
  Closes [GH-1570] [Bug #13387].

Revision 73c397ac
Added by normal over 1 year ago

thread_pthread: do not corrupt stack

This fixes stuck test/ruby/test_io.rb with FIBER_USE_NATIVE=0 on
GNU/Linux because linked-list pointers used by glibc get
corrupted when fiber stacks are copied.

Thanks to wanabe for finding the bug and original patch.

  • thread_pthread (native_thread_init_stack): fix stack corruption [ruby-core:82737] [Bug #13387]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60384 b2dd03c8-39d4-4d8f-98ff-823fe69b080e

Revision 60384
Added by normalperson (Eric Wong) over 1 year ago

thread_pthread: do not corrupt stack

This fixes stuck test/ruby/test_io.rb with FIBER_USE_NATIVE=0 on
GNU/Linux because linked-list pointers used by glibc get
corrupted when fiber stacks are copied.

Thanks to wanabe for finding the bug and original patch.

  • thread_pthread (native_thread_init_stack): fix stack corruption [ruby-core:82737] [Bug #13387]

Revision 60384
Added by normal over 1 year ago

thread_pthread: do not corrupt stack

This fixes stuck test/ruby/test_io.rb with FIBER_USE_NATIVE=0 on
GNU/Linux because linked-list pointers used by glibc get
corrupted when fiber stacks are copied.

Thanks to wanabe for finding the bug and original patch.

  • thread_pthread (native_thread_init_stack): fix stack corruption [ruby-core:82737] [Bug #13387]

Revision 60384
Added by normal over 1 year ago

thread_pthread: do not corrupt stack

This fixes stuck test/ruby/test_io.rb with FIBER_USE_NATIVE=0 on
GNU/Linux because linked-list pointers used by glibc get
corrupted when fiber stacks are copied.

Thanks to wanabe for finding the bug and original patch.

  • thread_pthread (native_thread_init_stack): fix stack corruption [ruby-core:82737] [Bug #13387]

Revision 12fc8129
Added by nagachika (Tomoyuki Chikanaga) over 1 year ago

merge revision(s) 60384: [Backport #13887]

    thread_pthread: do not corrupt stack

    This fixes stuck test/ruby/test_io.rb with FIBER_USE_NATIVE=0 on
    GNU/Linux because linked-list pointers used by glibc get
    corrupted when fiber stacks are copied.

    Thanks to wanabe for finding the bug and original patch.

    * thread_pthread (native_thread_init_stack): fix stack corruption
      [ruby-core:82737] [Bug #13387]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_2_4@62712 b2dd03c8-39d4-4d8f-98ff-823fe69b080e

Revision 62712
Added by nagachika (Tomoyuki Chikanaga) over 1 year ago

merge revision(s) 60384: [Backport #13887]

thread_pthread: do not corrupt stack

This fixes stuck test/ruby/test_io.rb with FIBER_USE_NATIVE=0 on
GNU/Linux because linked-list pointers used by glibc get
corrupted when fiber stacks are copied.

Thanks to wanabe for finding the bug and original patch.

* thread_pthread (native_thread_init_stack): fix stack corruption
  [ruby-core:82737] [Bug #13387]

Revision ca310ba6
Added by usa (Usaku NAKAMURA) over 1 year ago

merge revision(s) 60384: [Backport #13887]

    thread_pthread: do not corrupt stack

    This fixes stuck test/ruby/test_io.rb with FIBER_USE_NATIVE=0 on
    GNU/Linux because linked-list pointers used by glibc get
    corrupted when fiber stacks are copied.

    Thanks to wanabe for finding the bug and original patch.

    * thread_pthread (native_thread_init_stack): fix stack corruption
      [ruby-core:82737] [Bug #13387]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_2_3@62825 b2dd03c8-39d4-4d8f-98ff-823fe69b080e

Revision 62825
Added by usa (Usaku NAKAMURA) over 1 year ago

merge revision(s) 60384: [Backport #13887]

thread_pthread: do not corrupt stack

This fixes stuck test/ruby/test_io.rb with FIBER_USE_NATIVE=0 on
GNU/Linux because linked-list pointers used by glibc get
corrupted when fiber stacks are copied.

Thanks to wanabe for finding the bug and original patch.

* thread_pthread (native_thread_init_stack): fix stack corruption
  [ruby-core:82737] [Bug #13387]

History

#1

Updated by sorah (Sorah Fukumori) over 2 years ago

  • Status changed from Open to Closed

Applied in changeset trunk|r58211.


string.c: Supress logical-op-parentheses warning

#2

Updated by usa (Usaku NAKAMURA) about 2 years ago

  • Backport changed from 2.2: UNKNOWN, 2.3: UNKNOWN, 2.4: UNKNOWN to 2.2: DONTNEED, 2.3: DONTNEED, 2.4: REQUIRED

Updated by nagachika (Tomoyuki Chikanaga) about 2 years ago

  • Backport changed from 2.2: DONTNEED, 2.3: DONTNEED, 2.4: REQUIRED to 2.2: DONTNEED, 2.3: DONTNEED, 2.4: DONE

ruby_2_4 r58635 merged revision(s) 58211.

Also available in: Atom PDF