Skip to content

Reduce compile warnings#2871

Merged
soutaro merged 2 commits intoruby:masterfrom
ksss:reduce-warning
Mar 10, 2026
Merged

Reduce compile warnings#2871
soutaro merged 2 commits intoruby:masterfrom
ksss:reduce-warning

Conversation

@ksss
Copy link
Collaborator

@ksss ksss commented Mar 10, 2026

We found compile error on CLANGARM64 https://github.com/ruby/ruby/actions/runs/22716795417/job/65868368087#step:9:1106

../../../../../../src/.bundle/gems/rbs-3.10.3/ext/rbs_extension/../../src/parser.c:600:9: warning: jump from switch statement to this case label is incompatible with C++ [-Wjump-misses-init]
  600 |         default:
      |         ^
../../../../../../src/.bundle/gems/rbs-3.10.3/ext/rbs_extension/../../src/parser.c:580:41: note: jump bypasses variable initialization
  580 |             rbs_types_function_param_t *param = NULL;
      |                                         ^
../../../../../../src/.bundle/gems/rbs-3.10.3/ext/rbs_extension/../../src/parser.c:591:13: warning: jump from switch statement to this case label is incompatible with C++ [-Wjump-misses-init]
  591 |             KEYWORD_CASES
      |             ^
../../../../../../src/.bundle/gems/rbs-3.10.3/ext/rbs_extension/../../src/parser.c:63:5: note: expanded from macro 'KEYWORD_CASES'
   63 |     case k__TODO__:     \
      |     ^
../../../../../../src/.bundle/gems/rbs-3.10.3/ext/rbs_extension/../../src/parser.c:580:41: note: jump bypasses variable initialization
  580 |             rbs_types_function_param_t *param = NULL;
      |                                         ^

This compilation error can be reproduced by intentionally adding -Wjump-misses-init to the compilation options.

Additionally, I found that -Wreturn-type was also occurring during my investigation, so I have fixed it as well.

@ksss ksss added this to the RBS 4.0 milestone Mar 10, 2026
@ksss ksss changed the title Reduce warning Reduce compile warning Mar 10, 2026
@ksss ksss changed the title Reduce compile warning Reduce compile warnings Mar 10, 2026
@soutaro soutaro merged commit 2a75d8c into ruby:master Mar 10, 2026
25 checks passed
@ksss ksss deleted the reduce-warning branch March 10, 2026 09:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants